

[CSS21] colons are forbidden in type selectors

From: Elliotte Rusty Harold <elharo@metalab.unc.edu>
Date: Sat, 18 Oct 2003 11:25:06 -0400
Message-Id: <p06002002bbb70a2ea318@[]>
To: www-style@w3.org

I hope this is already dealt with in some section of the CSS 2.1 spec 
that I haven't read yet, but if not it's a significant issue.

Section 4.1.3 states:

10646 characters 161 and higher, plus the hyphen (-) and the 
underscore (_); they cannot start with a hyphen or a digit. They can 
also contain escaped characters and any ISO 10646 character as a 
numeric code (see next item). For instance, the identifier "B&W?" may 
be written as "B\&W\?" or "B\26 W\3F".

This rules out the colon character which is widely used in XML names. 
It is not possible given this to write a simple rule such as

pre:name { font-weight: bold}

You could escape the colon; e.g.:

pre\3Aname { font-weight: bold}

I can't find any other workaround in the spec. Ideally we'd want the 
ability to match on namespace URI and local name rather than 
qualified name. However, that will probably have to wait for CSS3. 
In the meantime, it's quite hard to match against colonized names, 
which are frequently used in XML. It's certainly not intuitive. Is 
there any way the colon can be allowed into CSS identifiers?


   Elliotte Rusty Harold
   Processing XML with Java (Addison-Wesley, 2002)
Received on Saturday, 18 October 2003 11:34:26 GMT
