Bug Tracker

Modify

Ticket #6980 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

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

comment:1 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

I have embedded XML in HTML and wanted to use find to traverse it

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.