[thelist] Problems traversing XML tree in JavaScript

Paul Waring paul at xk7.net
Tue Aug 2 07:35:48 CDT 2005


On Tue, Aug 02, 2005 at 02:24:34PM +0200, marcus wrote:
> responseXML.documentElement is the root element of the document. What is 
> happening is perfectly correct. I don't see the problem.

When I changed the code to:

response.req.responseXML;

it works the way I want, but surely <sites> isn't the root element of
the document because what would happen if I had say:

<sites><site id="10">site 1</site></sites>
<companies><company id="10">company 1</company></companies>

which one would responseXML.documentElement point at then? Or would it
be an array (meaning I'd have more than one root element, which I would
have thought is incorrect)?

Paul

-- 
Rogue Tory
http://www.roguetory.org.uk


More information about the thelist mailing list