[thelist] Problems traversing XML tree in JavaScript

VOLKAN ÖZÇELİK volkan.ozcelik at gmail.com
Tue Aug 2 07:45:55 CDT 2005


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

this is not a valid XML, each xml ought to have a topmost root node.

Or did I miss something again?


On 8/2/05, Paul Waring <paul at xk7.net> 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
> 
> --
> Rogue Tory
> http://www.roguetory.org.uk
> --
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>


More information about the thelist mailing list