Ticket #3404 (closed enhancement: duplicate)
a suggestion to workaround XML namespace selector problem
| Reported by: | sglai | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3 |
| Component: | selector | Version: | 1.2.6 |
| Keywords: | find | Cc: | |
| Blocking: | Blocked by: |
Description
To workaround xml namespace selector problem. May I suggest to handle xml document selector separately and put the browsers specific code in it. Code goes like this(tested with FF2 and FF3 and IE6):
find: function(t, context){
....
if (jQuery.isXMLDoc(elem)){ handle xml document here
var quickNStag = new RegExp("(#.?)([
w_-]*):([
w_-]*)|
.");
re2 = quickNStag;
m = re2.exec(t); m[0] = full name, m[1] = "." or "#", m[2] = namespace, m[3] = tagname
base on browser takes full name or just tag name
var tag = parseFloat(jQuery.browser.version) < 1.9 ? m[3] : m[0];
pass it to getElementsByTagName(tag)
...
}
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.

ok, I know we need a better RegExp to handle xml that has no namespace.