W3C home > Mailing lists > Public > www-style@w3.org > January 2007

Re: Question about linking CSS to XML vocabularies

From: James Justin Harrell <herorev@yahoo.com>
Date: Fri, 5 Jan 2007 17:33:17 -0800 (PST)
Message-ID: <20070106013317.82055.qmail@web50115.mail.yahoo.com>
To: www-style@w3.org


--- fantasai <fantasai.lists@inkedblade.net> wrote:

> .myclass and [class~="myclass"] have exactly the same specificity and
> match exactly the same set of 'class' attribute values.

The second part of that is only true when a UA recognizes a language that has defined an attribute
named "class" that is supposed to be used for such purposes. It is entirely possible for an
XML-based language to define a "class" attribute with different meaning and/or define that a
different attribute should match the period notation.

That means that with the below CSS and XML, it is impossible to know to style the XML without
knowledge of the XML namespace. When a UA doesn't recognize an XML namespace, it should ignore the
period notation.

para { color: white }
.test { background: black }

<doc xmlns="http://www.site.com/lang">
  <para class="test">I hope this shows.</para>
</doc>

It seems to me that since some people want to allow CSS to be applied to arbitrary XML and others
don't, CSS has ended up being sorta able sometimes to kinda half-ass apply styling to arbitrary
XML, but not anywhere near as well as when there is knowledge of the XML namespace.
Received on Saturday, 6 January 2007 01:40:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:49 GMT