...

View Full Version : Multiple xml data sources



dustywb
11-11-2010, 02:24 AM
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.

Old Pedant
11-11-2010, 03:01 AM
???? 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?

dustywb
11-11-2010, 04:19 AM
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");

TinyScript
11-11-2010, 05:19 AM
here's a good resource
http://www.hunlock.com/

Old Pedant
11-11-2010, 11:28 PM
Dusty: Wow. Surprise to me!

You'll make me go try this, now.

dustywb
11-12-2010, 12:52 AM
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.

Old Pedant
11-12-2010, 01:12 AM
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/>)

dustywb
11-12-2010, 05:58 AM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum