Klaus,

>Still there's an important difference between the two issues. A colon in
>an id is just a character and in a selector you would have to use the
>backslash to escape it. "Elements with colons in them" belong to a
>certain namespace (the name of the namespace is everything in front of
>the colon) and there is a special selector for them (which is currently
>not supported in jQuery as far as I know).

Well, namespaces in XPath can get a little goofy. I'm guessing jQuery
doesn't actually do anything w/namespace declaration, so I would think for
simplicities sake, you should be able to do "//news:special"; to return all
"special" nodes in the "news" namespace.

There's more on XPath and namespacing here:
http://bobcat.webappcabaret.net/javachina/faq/xpath_01.htm#xpath_Q15

>Selecting an id with a colon:
>
>#the\:id
>
>Selecting <news:special>Free chicken!</news:special> would look like
>(CSS 3 syntax - I don't know about XPath right now):
>
>news|special

I honestly did not realize that the CSS3 selector was so radically
different. It seems like the should have kept the same format as ID
selector:

#news\:special

That certainly would be more intuitive and consistent.

-Dan

Reply via email to