[thelist] Problems traversing XML tree in JavaScript

marcus m-lists at bristav.se
Tue Aug 2 07:49:11 CDT 2005

That kind of document would be illegal since all XML documents must have 
one and only one document root/element.


Paul Waring wrote:
> 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

More information about the thelist mailing list