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

On Wed, Sep 25, 2013 at 10:16 AM, Leif Halvard Silli
<xn--mlform-iua@xn--mlform-iua.no> wrote:
> Simon Sapin, Wed, 25 Sep 2013 14:41:51 +0100:
>> Le 25/09/2013 12:43, Leif Halvard Silli a écrit :
>
>>> Hence, these rules would not work in a namespace aware XML parser:
>>>
>>>        [xmlns] { color: green }
>>>     [xml:lang] { color: green }
>>
>> [xml:lang]
>
> Sorry, I forgot to escape: [xml\:lang]. So my point still stands: In a
> namespace aware XML parser, then this rule would not work
>
>     [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.

>>> Proposal: Please add a note/info that mentions @xml:foo and @xmlns as
>>> examples of common attributes that cannot, when occurring in a XML
>>> document, be styled with a simple [att]{} selector. It helps authors to
>>> understand the concept if they see an actual, non-theoretical, example.
>>>
>>> [1] http://dev.w3.org/csswg/selectors4/#attrnmsp
>>
>> I find this @xmlns parsing oddity more confusing than helpful in
>> understanding namespaces.
>
> Well, if it is confusing, then that *too* is a reason to offer
> explanation in the spec.

Well, not necessarily.  Bizarre quirks of individual languages that
authors are highly unlikely to run into don't necessarily need to be
explained in the CSS spec.  They should be if they're something
authors are likely to run into, but styling based on an xmlns
attribute seems rare. ^_^

~TJ

Received on Wednesday, 25 September 2013 17:42:09 UTC