[CSS21] colons are forbidden in type selectors

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:

  In CSS 2.1, identifiers  (including element names, classes, and IDs 
in selectors) can contain only the characters [A-Za-z0-9] and ISO 
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 UTC