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

Re: CSS2, 3.2 Conformance, point 4...

From: Bert Bos <bert@w3.org>
Date: Fri, 23 Mar 2007 20:08:52 +0100
Message-ID: <460425C4.5070808@w3.org>
To: "Fennell, Philip" <philip.fennell@hp.com>
CC: www-style@w3.org

Fennell, Philip wrote:
> Hello,
> 
> I am in the process of building a CSS 2 processor that takes as input an
> XML document and obtains any CSS style sheets referenced by the
> xml-stylesheet processing instruction. The processor then parsers the
> style sheet(s) and applies the CSS rules to the XML document. The output
> is the original XML document with CSS style property attributes embedded
> according to the CSS rules. A subsequent process will render the
> 'styled' XML document.
> 
> I have a query regarding point 4 of the conformance requirements.
> 
> Where, in point 4, it states that:
> 
> For each element in a document tree, it must assign a value for every
> applicable property according to the property's definition and the rules
> of cascading and inheritance.
> 
> 
> Can I take this to mean that in this most simple example:
> 
> Source document
> <feed>
> 	...
> </feed>
> 
> Style sheet
> feed {
>   display:block;
>   color:#000000;
> }
> 
> Result document
> <feed xmlns:css="http://www.w3.org/TR/REC-CSS2/" css:display="block"
> css:color="#000000">
> 	....
> </feed>
> 
> That every descendant of the 'feed' element will need to carry the
> inheritable css:color attribute in order for my implementation to claim
> conformance to CSS 2?

In principle, yes.

There are 100 or so properties in CSS2 and every element in a document 
has all properties. So in your format every element has 100 attributes 
(but most attributes will have the same value).

Of course, an implementation is free to optimize its memory use, as long 
as the result is the same. As usual in programming problems, there is a 
tradeoff between storage and computation. You can probably omit some 
attributes from your document at the cost of doing more work in the 
second process to compute what was omitted...



Bert

PS. I'm not sure it is a good idea to use http://www.w3.org/TR/REC-CSS2/ 
as your namespace. It is good practice to use a namespace that starts 
with a domain name that you own. As long as everybody does that, there 
is little chance that two people use the same namespace for different 
things.

-- 
   Bert Bos                                ( W 3 C ) http://www.w3.org/
   http://www.w3.org/people/bos                               W3C/ERCIM
   bert@w3.org                             2004 Rt des Lucioles / BP 93
   +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Friday, 23 March 2007 19:09:38 GMT

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