W3C home > Mailing lists > Public > www-style@w3.org > March 1998

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

From: Chris Lilley <chris@w3.org>
Date: Thu, 12 Mar 1998 00:17:19 +0100
Message-ID: <35071B7F.39F24D66@w3.org>
To: Steven Pemberton <Steven.Pemberton@cwi.nl>
CC: Ian Hickson <exxieh@bath.ac.uk>, Bert Bos <Bert.Bos@sophia.inria.fr>, www-style@w3.org
Steven Pemberton wrote:
> There is a change we could make to the semantics of |= that meets
> Ian's proposal halfway, and actually makes |= easier to implement, and
> moderately more useful.
> |= is currently defined on "hyphen-separated lists of
> "words"". However it is only so-defined because that is the structure
> of the LANG attribute.

Yes, that is exactly what it was defined for. We didn't invent the
hyphen separated hierarchical value, but we have to work with it.

> New proposal: let it match the head of the attribute being used, based
> on the length of the string being compared.

That won't work, because:
> So [LANG|="fr"] matches on the first two characters of LANG (language
> codes are always two-letters, so this still works)

Unfortunately not. x-piglatin, i-cherokee are examples where this is not
the case. It is true that if the first part is two letters, it is an ISO
language code (and if the second part is two letters it is an ISO
country code) but one- or more than two- letter codes are still valid.

> [LANG="en-nz"] still works, but
> [HREF|="mailto:"] would then also work.
> **** Note that according to HTML 4.0 the LANG attribute is case
> **** insensitive, which means that |= must match case-insensitively!!!

That's fine, the codes are all US-ASCII IIRC.

Chris Lilley, W3C                             http://www.w3.org/
Graphics,Fonts,Stylesheets Guy    The World Wide Web Consortium
http://www.w3.org/people/chris/              INRIA,  Projet W3C
chris@w3.org                       2004 Rt des Lucioles / BP 93
+33 (0)492 387 987 <NEW    06902 Sophia Antipolis Cedex, France
Received on Wednesday, 11 March 1998 18:29:55 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:46 UTC