#7545 closed defect (fixed)
DomParser: empty-element tags not implemented
Reported by: | chucky | Owned by: | Tom Trenka |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Dojox | Version: | 1.1.1 |
Keywords: | xml parser DomParser "self-closing tags" "empty-element tags" | Cc: | [email protected]… |
Blocked By: | Blocking: |
Description
dojox.xml.DomParser? does not parse document with empty-element tags (e.g. <br/>) correctly. As I looked into the source, it seems not to be implemented at all. However, no error is reported and the result is wrong.
Example:
var xml = '<root><one></one><two></two><three/><four></four><five></five></root>'; var dom = dojox.xml.DomParser.parse(xml); var children = dom.documentElement.childNodes var names = ""; for(var i in children){ names += children[i].nodeName + ' '; } alert(xml + ' has ' + children.length + ' nodes in the root element:\n' + names);
shows
<root><one></one><two></two><three/><four></four><five></five></root> has 2 nodes in the root element: one two
Change History (5)
comment:1 Changed 12 years ago by
Owner: | changed from Adam Peller to Tom Trenka |
---|
comment:2 Changed 12 years ago by
Milestone: | tbd → 1.3 |
---|---|
Status: | new → assigned |
comment:3 Changed 12 years ago by
OK, it's an expression issue. A space between the self-closing tag works, i.e. :
<three />
but when there is no space, the expression fails, i.e:
<three/>
Will fix for the 1.3 release.
comment:4 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:5 Changed 12 years ago by
Milestone: | 1.3 → 1.2 |
---|
Note: See
TracTickets for help on using
tickets.
Um, it is implemented; line 354 is the test for self-closing tags. If it's not working it might be regression bug introduced with a text node fix made by LiuCougar?.
I'll investigate.