#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: | |
Blocked by: | Blocking: |
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 (3)
comment:1 Changed 14 years ago by
comment:2 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
ok, I know we need a better RegExp to handle xml that has no namespace.