W3C home > Mailing lists > Public > www-style@w3.org > July 2002

Re: CSS in XML format ?

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 12 Jul 2002 09:17:17 -0400
Message-Id: <200207121317.JAA19335@no-knife.mit.edu>
To: "Patrick Andries" <pandries@iti.qc.ca>
cc: "Ian Hickson" <ian@hixie.ch>, "Rowland Shaw" <Rowland.Shaw@crystaldecisions.com>, www-style@w3.org

> > >  <declaration>
> > >   <property>color</property>
> > >   <value>
> > >    <rgba red="25%" green="100%" blue="0%" alpha="0.5" />
> > >   </value>
> > >  </declaration>

> >and the four rgba values still unparsed. It also dropped all the comments,
> which is a big loss.
> 
> A smiley was obviously missing here. Comments are available in XML...

Insert, in the above XML, comments corresponding to the following CSS:

color /* I like colors */
 : /* Silly separator */
 rgba( /* I like alpha blending too */
  25% /* Mmmmm red */
  , /* Another silly separator */
  100% /* Lots of green */
  , /* Another comma */
  0% /* Icky green, begone! */
  , /* So many separators! */
  0.5 /* Sorta-opaque-ish */
  )  /* And now we are done! */
  ;

I realize this is a slightly silly example, but Ian's initial example
was much more reasonable:

color: rgba( /* red */ 25%, /* green */ 100%, /* blue */ 0%,
             /* alpha */ 0.5);

And as you will note those comments _were_ dropped in the above XML
represenatation, and are _not_ capable of being included unless the
"25%", "100%", etc all get nodes of their own.  Doable, of course.  It
would then look like:

<declaration>
 <property>color</property>
 <value>
  <rgba>
    <!-- red -->
    <red value="25" unit="%" />
    <!-- green -->
    <green value="100" unit="%" />
    <!-- blue -->
    <blue value="0" unit="%" />
    <!-- alpha -->
    <alpha value="0.5" />
  <rgba>
 </value>
</declaration>

or so....

Boris
-- 
Modern art is what happens when painters stop looking at girls and 
persuade themselves that they have a better idea.
                                          -- John Ciardi
Received on Friday, 12 July 2002 09:17:30 GMT

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