Stephen Woodbridge wrote:
> 
> (...)
> Or escape the expression so we know it is explicitly XPath, or provide 
> a separate function that is dedicated to XPath.
> 
> -Steve
> 
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 
Both hands to this solution. Mixing two worlds together leads to
incompatibilities and limitations just because both syntaxes can overlap.

Providing separate function means dividing all core between $([CSS
selector]) and new $X([XPath expression]). I'm afraid it is not applicable.
So we have to turn to escaping XPath expressions so as to distinguish them
from CSS selectors.

To keep compatibility with previous version, unescaped calls can be
discriminated against "CSS" versus "Basic XPath" in current way; however,
those advanced XPath expressions that would collide with CSS syntax (and any
other, even "Basic", just explicitly mentioned as XPath) should be escaped
to force its interpretation.

It can be explicit escaping by special char (within string argument) or
optional parameter telling which syntax to use.

In my opinion, the second solution would be better.

Additional $ signature could be declared as follows:

jQuery $( String expr, Hash options )

with "options" containing CSS/XPath predicate, as well as additional
"context" parameter (see  http://jquery.com/api/#$ docs ), with open room
for future extensions. 

Maybe in jQuery 1.1 such solution could be applied?



-- 
View this message in context: 
http://www.nabble.com/jQuery-support-for-namespace-attributes-tf2636394.html#a7360528
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to