RE: [CSS21] colons are forbidden in type selectors

Hi ERH,

It is good to see you here :)

We use something like the following to get wysiwyg in our browser-based xml
editor:

c\:article {}
c\:title {}
c\:section {}

We have only done this with IE, since it is the only one that has
contentEditable (Oh.., if it could be a W3 standard...). Don't know how it
would work in other browsers or even if it is spec-compliant... but it
works...

Best,
-Rob

> -----Original Message-----
> From: www-style-request@w3.org [mailto:www-style-request@w3.org] On Behalf
> Of Elliotte Rusty Harold
> Sent: Saturday, October 18, 2003 8:25 AM
> 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:
> 
>   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
>    elharo@metalab.unc.edu
>    Processing XML with Java (Addison-Wesley, 2002)
>    http://www.cafeconleche.org/books/xmljava
>    http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA

Received on Saturday, 18 October 2003 11:59:59 UTC