using DOM to parse a XML file...

C

Charlie T

hello,

I need a little guidance here...
I am tring to parse out an XML file, but with some restrictions.

here is my XML FILE:
---------XML-----------
<XML>
<Cam name="01">
<loc>Newport</loc>
<lane des="ln1">
<spd>20</spd>
<ano>44</ano>
</lane>
<lane des="ln2">
<spd>55</spd>
<ano>11</ano>
</lane>
</Cam>
<Cam name="02">
<loc>Huntington</loc>
<lane des="ln1">
<spd>49</spd>
<ano>99</ano>
</lane>
<lane des="ln2">
<spd>88</spd>
<ano>00</ano>
</lane>
</Cam>
</XML>
-----------------------

What I want to do is collect all the data from each <lane> node and
place it into a string each value deliminated by a ',' .

example:
var c1ln1Data =("locNode.laneNode.spdNode.value,locNode.laneNode.anoNode.value")

But I only want to get this information if the camNode attribute
matches a value that I pass in....

i.e.:
<Cam name="01">.... if the 'name' value matches (var myNum) then parse
information that is a child of Cam01 *Only* then exit.

Any help is greatly appreciated!
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top