Re: CSS in XML format ?

On Wednesday 10 July 2002 16:53, Patrick Andries wrote:
> De: "Lachlan Cannon" <luminosity@members.evolt.org>
> > XSL is already in XML format, while CSS has it's own unique one. I find
> > the syntax of CSS to be much much more intuitive for what it does, and
> > would strongly object to it being rewritten in xml.
>
> Yes, I have heard this argument. Right now, having to convert it, I'm not
> at all convinced of its strength...

Pretty much the rest of the world is though, especially as there are other 
ways of solving your problem ;-)

Come to think of it, part of what makes CSS tick is its terseness. If you 
were to have 

<selector-list>
  <selector>
    <element-name>a</element-name>
  </selector>
</selector-list>

to express "a" you'd be crying. More likely, you wouldn't be using CSS 
because it'd be dead.

Your problem has two simple solutions. Either you need to parse CSS for a 
program of some sort, in which case you can use SAC (open source 
implementations available for at least Perl, C++, and Java). If you 
absolutely need to have some CSS expressed as XML, then just dump the SAC 
output as XML. A SAC2SAX filter would be at most half a day's work. The fact 
that something as trivial as that isn't available (that I know of) shows just 
how much interest there is in having CSS expressed as XML.

Once you have the XML, you can run XSLT on it to your heart's content. It 
doesn't need to be standardised, very few things do.

-- 
Robin Berjon <robin@knowscape.com> -- for hire: http://robin.berjon.com/
  A message brought to you by UFO, the Unshaven French Object.

Received on Wednesday, 10 July 2002 11:54:52 UTC