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

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

From: Fennell, Philip <philip.fennell@hp.com>
Date: Mon, 26 Mar 2007 14:43:50 +0100
Message-ID: <C4B3FB61F7970A4391A5C10BAA1C3F0D811D9E@sdcexc04.emea.cpqcorp.net>
To: <www-style@w3.org>


> There are 100 or so properties in CSS2 and every element in a document
has all properties.

I had only planned on creating css attributes where they had been
declared in the input style sheet.
But, it now occurs to me that there are a considerable number of css
properties that have an initial value and therefore, those properties
should be present in the out XML as they all play a part in rendering
the result.

Ho hum...

...I hadn't thought of that!

Thanks for your help.


Philip Fennell

PS: It has become my firm opinion that if you really want to understand
how something works, then you have to make one of your own.
Of course it can end in tears as Dr. Frankenstein found out but its
worth a punt.

Now, I'll need Igor's help if I'm to find room for a hundred attributes
on every element...

-----Original Message-----
From: Bert Bos [mailto:bert@w3.org] 
Sent: 23 March 2007 19:09
To: Fennell, Philip
Cc: www-style@w3.org
Subject: Re: CSS2, 3.2 Conformance, point 4...

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


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

   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 Monday, 26 March 2007 13:44:21 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:28 UTC