Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Nov 2004
    Posts
    55
    Thanks
    8
    Thanked 2 Times in 1 Post

    Question Multiple xml data sources

    I've been looking around and haven't been able to find much on the subject. Anyways I'm wondering how to pull data from more than one xml source on a single page. I've found people referencing the subject but nothing concrete on how it's done. Any help would be much appreciated.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,027
    Thanks
    79
    Thanked 4,436 Times in 4,401 Posts
    ???? You pull from one, then you pull from the next, then you pull from the third, then you...

    There's nothing magic about one versus many.

    Or are you talking about using XSL to style an entire page from XML?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New Coder
    Join Date
    Nov 2004
    Posts
    55
    Thanks
    8
    Thanked 2 Times in 1 Post
    I should have been more descriptive, I apologize. Anyways if I do this:

    xmlhttp.open("GET","xml/sales.xml",false);
    xmlhttp.send();
    xmlDoc1=xmlhttp.responseXML;
    xmlhttp.open("GET","xml/time.xml",false);
    xmlhttp.send();
    xmlDoc2=xmlhttp.responseXML;

    which I've tried, I get undefined, just a few minutes ago I noticed it does work in firefox but in chrome or ie I get undefined for any data I try to pull out of the xml file using something like

    xmlDoc1(or 2).getElementsByTagName("row")[1].getAttribute("attribute");

  • #4
    Regular Coder
    Join Date
    Mar 2009
    Location
    Portland Oregon
    Posts
    690
    Thanks
    44
    Thanked 63 Times in 62 Posts
    here's a good resource
    http://www.hunlock.com/

  • Users who have thanked TinyScript for this post:

    dustywb (11-12-2010)

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,027
    Thanks
    79
    Thanked 4,436 Times in 4,401 Posts
    Dusty: Wow. Surprise to me!

    You'll make me go try this, now.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #6
    New Coder
    Join Date
    Nov 2004
    Posts
    55
    Thanks
    8
    Thanked 2 Times in 1 Post
    Quote Originally Posted by Old Pedant View Post
    Dusty: Wow. Surprise to me!

    You'll make me go try this, now.
    Now when I said
    xmlDoc1(or 2).getElementsByTagName("row")[1].getAttribute("attribute");

    I didn't literally mean I put xmlDoc1(or 2) I put xmlDoc1 if the data was in the first file or xmlDoc2 if the data was in the second file lol I'm assuming that's the surprise here, if not then idk what else it is, I use javascript rarely and am pretty rusty with it atm having to relearn a bunch of stuff.

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,027
    Thanks
    79
    Thanked 4,436 Times in 4,401 Posts
    No no, I understood exactly what you meant. You mean that the two responseXML's seem to be interfering with each other. Truly, that's a huge surprise to me. Esp. that it would work in FF but not in Chrome. (NOTHING that fails in MSIE surprises me, any more. <grin/>)
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #8
    New Coder
    Join Date
    Nov 2004
    Posts
    55
    Thanks
    8
    Thanked 2 Times in 1 Post
    Quote Originally Posted by Old Pedant View Post
    No no, I understood exactly what you meant. You mean that the two responseXML's seem to be interfering with each other. Truly, that's a huge surprise to me. Esp. that it would work in FF but not in Chrome. (NOTHING that fails in MSIE surprises me, any more. <grin/>)
    O ok lol, as I said and I'm sure it's also obvious I am not an expert coder. I've been around this stuff for a long time and know some of the basics but haven't taken the time to master it. Working with a lot of this stuff is very infrequent for me.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •