Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using XML Data in different webpages

Status
Not open for further replies.

edcata

Programmer
Feb 26, 2009
1
US
I am very new at XML data sets and I've been able to get it to work with one of my pages and it list all the data I have in the XML file.

What I can't figure out is if there is a way to use parts of the data and have it displayed on a different page?

EX: I have 32 courses with different types info that I have all displayed on one page. I'd like to be able to use one of those courses discription on a different webpage how do I tell the HTML page to just read parts of the XML file?
 
first you need to point to the xml file using something like this:
xmlDoc.load("note.xml");

and you have to play with the tags name like on the sample below

xmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue

* xmlDoc - the XML document created by the parser.
* getElementsByTagName("to")[0] - the first <to> element
* childNodes[0] - the first child of the <to> element (the text node)
* nodeValue - the value of the node (the text itself)


for more details and samples , look at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top