X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fselector%2Fselector.js;h=366cf31883016498e6dd379d146cd7d97239e25f;hb=e6c067858ec7f2c4e3e7da90f16c695f93a4ee07;hp=a78cb310f7a4c3769610e421d9df2e8251e5bf9e;hpb=bdb5dad8e521c060980e3efecb53b81b15ce74b0;p=jquery.git diff --git a/src/selector/selector.js b/src/selector/selector.js index a78cb31..366cf31 100644 --- a/src/selector/selector.js +++ b/src/selector/selector.js @@ -99,7 +99,7 @@ jQuery.extend({ // Handle the common XPath // expression if ( !t.indexOf("//") ) { - context = context.documentElement; + //context = context.documentElement; t = t.substr(2,t.length); // And the / root expression @@ -142,7 +142,7 @@ jQuery.extend({ if ( t.indexOf(" ") == 0 ) continue; foundToken = true; } else { - re = /^((\/?\.\.)|([>\/+~]))\s*([a-z]*)/i; + re = /^((\/?\.\.)|([>\/+~]))\s*(\w*)/i; if ( (m = re.exec(t)) != null ) { r = []; @@ -213,7 +213,7 @@ jQuery.extend({ var elem = ret[ret.length-1]; // Try to do a global search by ID, where we can - if ( m[1] == "#" && elem && elem.getElementById ) { + if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) { // Optimization for HTML document case var oid = elem.getElementById(m[2]);