Re: CSS in XML format ?

Patrick Andries wrote:
 > I would like to do convert strict XHTML + CSS documents to some other
 > format using XSLT.

What other format? Is it a presentational format? (In which case, are
you effectively writing a CSS renderer?) Or is it a structural format?
(In which case, why do you want to preserve the styling hints?)


 > Unfortunately, the CSS syntax is very hard (to use a euphemism) to
 > interpret with XSLT.

XSLT sucks. (That's just my personal opinion.)

I highly recommend using Perl with the XML::Parser and SAX::CSS
modules (or any of the numerous other XML and CSS modules). Unless you
already know XSLT as well as some [1], then Perl is going to be a lot
easier for you.


 > Is there an initiative to have CSS use XML syntax?

CSS is not a tree-like language, XML is not suitable for representing
the content of CSS.

Please try to get away from the idea that everything must be written
in XML. XML is only useful for a limited subset of the document types
out there, namely linear tree-based structures.

Especially don't fall prey to the notion that because your tool (XSLT)
has limitations (only being able to handle XML), everything should fit
those limitations. Paraphrasing an old saying: "When all you have is a
hammer, you want everything to be a nail."


[1] Some people... http://people.w3.org/maxf/ChessGML/

-- 
Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'

Received on Wednesday, 10 July 2002 18:34:09 UTC