Skip to main content

Bug Tracker

Side navigation

#3404 closed enhancement (duplicate)

Opened September 24, 2008 09:51AM UTC

Closed November 13, 2010 07:39PM UTC

Last modified November 13, 2010 07:39PM UTC

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:

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)



Attachments (0)
Change History (3)

Changed September 24, 2008 10:12AM UTC by sglai comment:1

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

Changed November 13, 2010 07:39PM UTC by dmethvin comment:2

resolution: → duplicate
status: newclosed

Changed November 13, 2010 07:39PM UTC by dmethvin comment:3

Duplicate of #1826.