Re: Question about linking CSS to XML vocabularies

--- 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 UTC