Re: [selectors4] List [xml:lang] and [xmlns] as selectors that do not work in XML

Simon Pieters, Thu, 26 Sep 2013 10:06:38 +0200:
> On Wed, 25 Sep 2013 19:34:19 +0200, Tab Atkins Jr. wrote:
> 
>>>     [xml\:lang] { color: green } /* escaped the colon. */
>> 
>> Correct, that wouldn't work, because "xml:" isn't part of the
>> attribute's name, it's the syntax used to declare a namespace for the
>> attribute.  This has nothing to do with xml:lang - all namespaced
>> attributes work like this.
> 
> So a more appropriate example is that the following doesn't select an 
> xml:lang attribute:
> 
>    [lang] { ... }

That’s a good example. (Although, since it is common to include both 
xml:lang= and lang=, it could still work…)

> Although it seems reasonable to assume that some authors are going to 
> try [xml:lang] and [xml\:lang] if they want to select it and don't 
> know how namespaces work... I'm not convinced that the Selectors spec 
> needs to explain how namespaces work, though.

Neither did I propose the selectors 4 spec should do that.

> It's confusing, but 
> most authors don't need to care, and explaining it in the spec seems 
> like it would cause many authors who don't have to care spend time 
> trying to understand it, effectively wasting their time.

As I told Tab, Selectors 4 already have a section that explains about 
[foo|bar], so there is already a risk that authors try to understand 
that section. Providing the [lang]{ … } example could help them 
understand, making them waste less time.

But with regard to what authors might try, then I think it is more like 
that they are going to try – and find that it doesn work – to do 
[xmlns]{ … }, since, unlike e.g. xml:@lang (which often is co-existing 
with a @lang), the xmlns= attribute doesn't include any prefix - hence 
authors are less likely to be aware that there is something special to 
it.
-- 
leif halvard silli

Received on Thursday, 26 September 2013 10:32:58 UTC