Bug Tracker

Opened 14 years ago

Closed 12 years ago

Last modified 9 years ago

#4208 closed bug (wontfix)

Selector inconsistency with XML Namespaces

Reported by: janrito Owned by: john
Priority: minor Milestone: 1.next
Component: selector Version: 1.3.2
Keywords: needsreview xml Cc:
Blocked by: Blocking:


On a namespaced xml element like:


In Firefox it will match with:


This won't match the element in Safari though. In Safari it will match with:


This is a problem, since it will match any element regardless of the namespace:

<media:thumbnail> <dc:thumbnail> <thumbnail>

Firefox won't match any without the namespace. I have been able to match the correct element by checking the node name:

jQuery('item', xml).find('[nodeName="media:thumbnail"]');

Change History (6)

comment:1 Changed 12 years ago by dmethvin

Keywords: needsreview xml added
Status: newopen

comment:2 Changed 12 years ago by danheberden

Milestone: 1.41.next

Related to #4120

comment:3 Changed 12 years ago by thingsinjars

This might be related to #4120 but this is more about the inconsistency between browsers. There's a test case here:


I investigated this one a bit and found that nodes with a namespace created using document.createElement are detectable in IE6/7/8 using an escaped jQuery selector: div.appendChild(document.createElement('a:bc'))

$(div).find('a\\:bc').length // equals 1


The same nodes created with the same namespace are not detectable by IE6/7/8 when they are created with .html():

$('<div/>').html('<a:bc/>').find('a\\:bc').length // equals 0

Instead, those nodes are detectable without the namespace:

$('<div/>').html('<a:bc/>').find('bc').length // equals 1

If there's no consistent way to get around the browser inconsistency, there's an addition to $.support to detect this behaviour in the jsfiddle.

comment:4 Changed 12 years ago by thingsinjars

There's more IE namespace investigation detailed here along with more jsfiddle testcases:


I'm now definitely of the opinion that there isn't a way to patch this odd namespace behaviour in IE6/7/8 and it should be added to $.support.

comment:5 Changed 12 years ago by john

Resolution: wontfix
Status: openclosed

This isn't something that we're going to fix: http://docs.jquery.com/Won%27t_Fix

comment:6 Changed 9 years ago by gavenkoa

FYI this page still live: http://contribute.jquery.org/wont-fix/ (support issues with SVG/WML/etc).

Note: See TracTickets for help on using tickets.