473,785 Members | 2,482 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help me finish my code... im stuck

SM
Hello,
I have a xml file that contains the CD library of one artist. I want
to extract all the tracks from a specific CD. I was able to extract
the title of all the cd's but not the tracks of one specific CD.
How can i extract track titles from a specific CD?

Here's how my code looks like:
var xmlResponse = xmlHttp.respons eXML;

xmlRoot = xmlResponse.doc umentElement;

var arrayCD = xmlRoot.getElem entsByTagName(' title');

for (var i=0; i<x.length; i++)
{
html += arrayCD[i].childNodes[0].nodeValue + '<br />';
}

//obtain a reference to the <divelement on the HTML page
myDiv = document.getEle mentById("myDiv Element");

//display the HTML output
myDiv.innerHTML = "Tracks: <br />" + html;

I also notice that by specifying a number in the string
'arrayCD[2].childNodes[0].nodeValue' i can access a specific cd.

arrayCD[0].childNodes[0].nodeValue // to access cd 1
arrayCD[1].childNodes[0].nodeValue // to access cd 2
arrayCD[2].childNodes[0].nodeValue // to access cd 3

I know im close, but im kinda lost.... that's why i need your help

Here's how my xml file looks like:
<?xml version="1.0" encoding="UTF-8" standalone="yes "?>
<discography>
<cd>
<title>Hello</title>
<track>
<title>I want you</title>
<title>Daydream er</title>
<title>Melody </title>
</track>
</cd>
<cd>
<title>White</title>
</cd>
<cd>
<title>Can you</title>
</cd>
<cd>
<title>Why</title>
</cd>
<cd>
<title>Help</title>
</cd>
</discography>

Thanks
Marco

Mar 14 '07 #1
0 1176

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2828
by: akickdoe22 | last post by:
Please help me finish this program. i have completed the addition and the subtraction parts, but i am stuck on the multiplication and division. any suggestions, hints, code, anyhting. it's not a true large int calculator, the numbers entered are at max 100 intergers. CODE SO FAR: #include<iostream> //libraries limited to #include<string> using namespace std;
7
2685
by: Eric Whittaker | last post by:
Hey guys, i am relatively new at this programming thing and am stuck on an assignment here. I'm trying to get the program below to respond to the integer -1 to stop and calculate total. It does, but it makes me enter -1 under both gallons and miles, how can i avoid this? Thanks. //Figures gas mileage in gallons #include <iostream> #include <conio.h>
8
19601
by: Andrew McNab | last post by:
Hi folks, I have a problem with an MS Access SQL query which is being used in an Access Report, and am wondering if anyone can help. Basically, my query (shown below) gets some records from a couple of tables in my database using INNER JOINS and the WHERE clause to specify the required constraints. However, I also want to read two fields from a *single* record from a table called 'Locations' and then apply one of these field's values...
1
1460
by: Esteban Felipe | last post by:
Hi, thanks for reading. I hope to find some help here before I commit suicide because this is driving me crazy. Please excuse me if this looks like a long post, but I hope that a complete explanation help you to help me :=) ....Let's start with some background: ..- I'm building an asp.net application that requires users to upload text files in cvs format with data exported from an AS-400. ..- The files will be something between 800kb...
0
1629
by: TN Bella | last post by:
Hi, I am trying to get my compare validator to fire properly...Since I have panels the validator wouldn't work properly, the app would fire right but would insert the data regardless and the user couldn't fix an error if they had an error. So I added another sub and fixed the panels, but the compare validator still doesn't work right. Right now the validator pops up with the error that the two values (txtAcctAmtSum and txtInvAmt) are...
6
3014
by: theGreatGnu | last post by:
Hi all, I am new to PHP, Apache and Mysql. But I least I have managed to install everything on my home computer on my own and everything is up and running. I can fetch data from the database and display it. So far, so good. However, I'm stuck on an irritating problem. Whenever I connect to mysql, my PHP pages don't want to finish loading. In the following example, the page will not finish loading nor display "abc" until I
0
5576
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
3
12781
by: dedalusenator | last post by:
Hello Folks, My first posting here and I am a stuck in figuring out the exact way to update a global variable from within a function that doesnt return any value (because the function is a target of the thread and I dont know how exactly return would work in such a case). I am sure I am missing something very fundamental here. The essential pieces of my code that cause the problem would be something like this:...
2
1544
by: swanside | last post by:
Hello all, Found this forum Google as I am trying to find out why my database is returning multiple results when I use the JOIN to join two tables together. Here is the code I am using, select job.Job_No, Working_Hrs*Paying_Rate, Quantity*Unit_Price from job left join labour on (job.Job_No=labour.Job_No) left join material
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10324
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10090
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9949
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.