Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

childNodes/getElementsByTagName - XML parsingproblem in Firefox

Status
Not open for further replies.

rravenn

Programmer
Jul 6, 2004
40
US
Hi. I have the following xml in xml element

<commands><command oid="2" name="open" clientHandler="openHandler" /><command oid="27" name="padd" server="1"><argument quote="0" oid="26" name="Parent" autocomplete="1" /><argument quote="0" oid="28" name="State" autocomplete="1" /><argument quote="0" oid="43" name="Name" /></command><command oid="28" name="aadd" commandAC="1" server="1" /> .... </commands>

Some commands are with/without arguments.
the problem is that when I browse that in HTML I see that command w/oid 27 (padd) has one item in childNodes - arg w/oid 26; it has one child, argument w/oid 28, and it in turn has two children - next argument and next command.

Likewise when I do getElementsBytagName("argument") for command w/oid 27, I get all the subsequent argument tags regardless of real parents. Like, wtf? What about />? One thing to note is that both Ie and Firefox display this XML correctly when I copy-paste it into separate file; and IE also parses it correctly.

What's wriong with Firefox?
 
Hrrrm, I mean edit it in javascript. or not even edit, just look at it before editing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top