W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2009

[selectors-api] querySelector with namespace

From: Jonathan Watt <jwatt@jwatt.org>
Date: Thu, 26 Nov 2009 12:18:30 +0100
Message-ID: <4B0E6406.3060404@jwatt.org>
To: public-webapps@w3.org
Hi,

During a discussion about xml:id I was about to make the throw away comment that
you could use querySelector to easily work around lack of support for xml:id,
but on checking it turns out that's not the case. querySelector, it seems,
cannot be used to select on a specific namespace, since you can only use
namespace prefixes in selectors, and querySelector does not resolve prefixes.

Maybe the working group could consider adding some sort of "non-prefix"
namespace support to selectors for the sake of querySelector/querySelectorsAll,
something like:

  [url("http://www.w3.org/XML/1998/namespace")|id="foo"]

or:

  [namespace("http://www.w3.org/XML/1998/namespace")|id="foo"]

or:

  [ns("http://www.w3.org/XML/1998/namespace")|id="foo"]

I imagine this would be much more widely useful than just for xml:id of course.

Jonathan
Received on Thursday, 26 November 2009 11:18:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:35 GMT