469,345 Members | 6,515 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,345 developers. It's quick & easy.

Get n element of an XML file using JavaScript DOM

SM
I have an XML that contains all the CDs from one artist only.
If the user requests more info on cd #2, then all the tracks from the
cd#2 are shown to him.

How do i achieve that?

Heres how my XML look like

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<discography>
<cd>
<title>CD1</title>
<track>
<title>track01</title>
<title>track02</title>
<title>track03</title>
<title>track04</title>
<title>track05</title>
<title>track06</title>
<title>track07</title>
<title>track08</title>
<title>track09</title>
<title>track10</title>
</track>
</cd>
<cd>
<title>CD2</title>
<track>
<title>track01</title>
<title>track02</title>
<title>track03</title>
</track>
</cd>
</discography>
....
var xmlResponse = xmlHttp.responseXML;
xmlRoot = xmlResponse.documentElement;
....
Thanks
Marco

Mar 29 '07 #1
2 1110
SM said the following on 3/29/2007 12:06 PM:
I have an XML that contains all the CDs from one artist only.
If the user requests more info on cd #2, then all the tracks from the
cd#2 are shown to him.

How do i achieve that?
Write some code (either client or server side) to show them the data
they requested.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 29 '07 #2
SM
On Mar 29, 1:40 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
SM said the following on 3/29/2007 12:06 PM:
I have an XML that contains all the CDs from one artist only.
If the user requests more info on cd #2, then all the tracks from the
cd#2 are shown to him.
How do i achieve that?

Write some code (either client or server side) to show them the data
they requested.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
D'oh!

Mar 29 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jacqueline Snook | last post: by
6 posts views Thread by Luke Dalessandro | last post: by
27 posts views Thread by one man army | last post: by
7 posts views Thread by Ed Jay | last post: by
15 posts views Thread by Sunny | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.