Dan G. Switzer, II schrieb:
Sean,
I know that jQuery made the decision not to allow selection of
elements with colons in them, however it is valid XML. Here is an
example piece of code I am getting back from an ajax call:
<item>
<news:special>Free chicken!</news:special>
</item>
Any ideas how I can select the news:special item?
There is a similar ticket opened up dealing with id selectors with colons in
the name:
http://dev.jquery.com/ticket/143
It's marked as fixed, but I'm not sure if the fix also addresses nodes
w/colons in their name.
-Dan
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).
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
-- Klaus