#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: |
Description
On a namespaced xml element like:
<media:thumbnail>
In Firefox it will match with:
jQuery('media
:thumbnail')
This won't match the element in Safari though. In Safari it will match with:
jQuery('thumbnail')
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
Keywords: | needsreview xml added |
---|---|
Status: | new → open |
comment:2 Changed 12 years ago by
Milestone: | 1.4 → 1.next |
---|
comment:3 Changed 12 years ago by
This might be related to #4120 but this is more about the inconsistency between browsers. There's a test case here:
http://jsfiddle.net/thingsinjars/xaKLn/
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
But...
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
There's more IE namespace investigation detailed here along with more jsfiddle testcases:
http://thingsinjars.com/post/371/investigating-ies-innerhtml/
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
Resolution: | → wontfix |
---|---|
Status: | open → closed |
This isn't something that we're going to fix: http://docs.jquery.com/Won%27t_Fix
comment:6 Changed 9 years ago by
FYI this page still live: http://contribute.jquery.org/wont-fix/ (support issues with SVG/WML/etc).
Related to #4120