CSS Query API vs Core lookupNamespaceURI

Hi,

  If an attribute node stores a selector and the in-scope namespace
declarations are to be used to expand names in the selector, the most
natural way to set that up would simply be with

  example.querySelector(attr.value, attr.lookupNamespaceURI);

Or with a wrapper function if necessary to the same effect. However,
due to differences between the resolvers this might not work as ex-
pected, in particular, Core's lookupNamespaceURI expects a "null"
argument to find the default namespace, but the querySelector imple-
mentation would pass the empty string (presumably Core should accept
the empty string aswell), and if an XML 1.1 document uses

  <example selector='a|b' xmlns:a='' ...>

The expected result would be that only 'b' elements in no namespace
would be matched, but per "If there was no NSResolver object provided,
or if the method returns an empty string or does not return a DOMString,
the prefix represents an unresolvable namespace" the code would actually
match 'b' elements in any namespace and elements in no namespace.

This difference should either be removed or be explained in the
document. For the other issue, either querySelector passes null to get
the default namespace, or an issue against DOM Core should be filed.

regards,
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Tuesday, 22 April 2008 15:58:45 UTC