Ticket #6980 (closed bug: invalid)
self closed tags not well handled by .find()
| Reported by: | johnccr | Owned by: | |
|---|---|---|---|
| Priority: | Milestone: | 1.4.3 | |
| Component: | traversing | Version: | 1.4.2 |
| Keywords: | self-closed tags embedded xml | Cc: | |
| Blocking: | Blocked by: |
Description
I have embedded XML in HTML and wanted to use find to traverse it, while this worked very well in IE7, on firefox3 was a mess, after some testing I realized it was because of self-closed tags. So the following XML <Section id="6" name="Compliance">
<Requirement id="6.1">
<Description>Compliance</Description> <AppliesTo>
<Characteristic></Characteristic>
</AppliesTo> <Recommendations>
<General>Identify compliance required by your application</General> <Java></Java> <DotNET></DotNET> <PHP></PHP>
</Recommendations>
</Requirement>
</Section>
will become
<Section id="6" name="Compliance">
<Requirement id="6.1">
<Description>Compliance</Description> <AppliesTo>
<Characteristic></Characteristic>
<Recommendations>
<General>Identify compliance required by your application</General> <Java> <DotNET> <PHP></PHP>
</DotNET>
</Recommendations>
</Requirement>
</Section>
</Java>
If I change the <Java/> tag to <Java></Java> traversing works fine.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Is your doctype XML, XHTML, or HTML? The browser will change the way it parses the document based on that. Please reopen with a test case so it's clear what is happening.