Re: Suggestion for Attribute Selectors (and answer to Q[lang] problem)

Ian Hickson wrote:
> 
> Bert Bos wrote:
> >  1. what do we need to match on?

> Good question. Depends on the attribute. Since CSS is for use with XML too
> though, we shouldn't make *any* assumptions about which attribute does what
> (I was suprised that @class was removed from the draft). 

With the adoption of the explicit means of selecting on a particular
attribute and the means to deal with attribute values which are space
separated lists, there was no longer any need to indicate which one
attribute was to be treated as "class".

> It makes me worried
> that the suggestion given below is specific to one attribute. In my first
> XML DTD, I was going to use "language" as my attribute for setting language
> context.

It isn't specific to one attribute. As Bert says, it will work whether
the HTML language is set using META, HTTP headers, or the lang
attribute.

For XML applications, it will get the xml:lang attribute which, as with
the HTML lang attribute, inherits threought the source tree. For example

<foo xml:lang="en-nz">
  <bar>
    <baz>some stuff</baz>
  </bar>
</foo>

the baz element is in New Zealand English. Your language attribute would
no inherit like this, so you would have to duplicate it on all
descendent elements.

The fact that both HTML 4.0 and XML define the same semantics of a
source-tree-inheriting property (with additional complications for the
value of the root node, in HTML) was a big part of the decision to make
this information available for any element without requiring verbose
stylesheets.
 

> >We have, however, decided to add the operator "|=", specifically for
> >matching language codes:
> >
> >    [lang |= fr]
> >
> >will match all language codes whose first segment is "fr": "fr", "fr-ca",
> >"fr-fr-argot", etc.
> 
> Sorry?! This is suprisingly similar to my original suggestion, which you've
> just rejected! The only example I gave which could *not* be done this way
> was the one which tested the end of the domain name (see my original post
> for details).

Yes. I appreciate that from your perspective you made a suggestion, it
was rejected then a similar one was accepted. I hope you dont feel
slighted. The actual proposal for the language handling in CSS2, and
it's acceptance by the working group, predated your proposal.


> BTW, you only rarely get more than two levels of quoting, if you had any
> more the quote would be so long as to no longer warrant being in-line. 

True, but there still needs to be defined behaviour to cope with the
rare case.

--
Chris

Received on Monday, 9 March 1998 09:04:22 UTC