Bug Tracker

Modify

Ticket #3404 (closed enhancement: duplicate)

Opened 6 years ago

Last modified 3 years ago

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

comment:1 Changed 6 years ago by sglai

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

comment:2 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to duplicate

comment:3 Changed 3 years ago by dmethvin

Duplicate of #1826.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.