473,390 Members | 1,301 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,390 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 1182
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.