How to handle Muli-record of responseXML?

C

Cylix

I have read a number of article about the responseXML,
all articles just mention one row XML, I mean
<book>
<name>The Sea</name>
<authur>Jogn</authur>
</book>

javascript:
xmlHttp.responseXML.documentElement.getElementsByTagName("name").childNodes[0].nodeValue

But no one talk about XML like the following:
<book>
<name>The Sea</name>
<authur>Jogn</authur>
</book>
<book>
<name>The Sea2</name>
<authur>Jogn</authur>
</book>

How to handle in javascript for the 2nd XML?
Thanks!
 
B

Bart Van der Donck

Cylix said:
I have read a number of article about the responseXML,
all articles just mention one row XML, I mean
<book>
<name>The Sea</name>
<authur>Jogn</authur>
</book>

But no one talk about XML like the following:
<book>
<name>The Sea</name>
<authur>Jogn</authur>
</book>
<book>
<name>The Sea2</name>
<authur>Jogn</authur>
</book>

XML can only have one root tag (<book/> of your first example). For
your second example, you could surround it by <library/> or something
and it'll be okay.
 

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

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,429
Latest member
JacelynKit

Latest Threads

Top