473,395 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1184
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jacqueline Snook | last post by:
Hi, I am working on a website that uses a SVG diagram with multiple polygons (to represent rooms in a hotel). Each polygon has a class to represent whether the room is single or double. In a...
6
by: Luke Dalessandro | last post by:
I'm not sure if this is the correct forum for platform specific (Mozilla/Firefox) javascript problems, so just shout and point me to the correct newsgroup if I'm being bad. Here's the deal... ...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
3
by: SM | last post by:
Hello, Im trying to access elements in my XML file using the JavaScript DOM but i'm not sure how. I use AJAX to access the XML and then use the responseXML property to access the XML file data. I...
7
by: Ed Jay | last post by:
I'm trying to validate a form's file input elements using javascript, but I'm getting nowhere. How can javascript test if a file has been selected using a file form input element? -- Ed Jay...
10
by: Sebarry | last post by:
Hi, I'm using the code at http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/ to upload multiple files with a single file element. It works fine...
9
by: mevryck | last post by:
Greetings I have a huge Javascript with inclusion of external scripts and all. I got this by doing a XSLT . Now I have the contents in a Javascript variable, but I'm not able to update the...
3
by: Sirisha | last post by:
Hi ... Is it possible to drag a file from Client Desktop into the Browser Form File Element(input type='file') instead of File Browse? I know that, File drag is possible in the Mozilla Firefox...
5
by: montybytes | last post by:
Hi there, Although, I have already placed this question in the HTML/CSS section, perhaps it might be worthwhile asking the question here as well. I have a JavaScript function which retrieves...
15
by: Sunny | last post by:
Hi, I can change the lement opacity in IE using. abc.style.filter = 'alpha(opacity=' + 10 + ')'; But this dont work in firefox, In firefox it throws error. How I can change the opacity of an...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.