Re: syntax feedback

Subject: Re: syntax feedback
From: Chris Lilley <chris@xxxxxx>
Date: Tue, 15 Dec 1998 21:23:11 +0100

Paul Prescod wrote:

> CSS and XSL are to have a common formatting model. 

Correct

> If so, CSS
> can be "compiled" into an XSL stylesheet rather easily.
> 
> LI      {       display: list-item;     }
> 
> compiles to:
> 
> <xsl:template match="LI">
>         <list-item>...</list-item>
> </xsl:template>

Yes

> Of course you don't compile to a real XSL file.

But you could; for example, if the compilation happened server-side

>  You just share an
> execution model internally. 

That is most likely, in code that implements both specifications.


> I predict that I could implement this
> converter in less than a programmer-week.

Is that a full converter that takes any legal CSS2 stylesheet and emits
legal XSL which results in the same rendering? Or just a proof of
concept tool that generates the simple cases such as that shown above?

> > 'CSS was never even a
> > contender because it did not do transformations'. So why not build a
> > transformation engine and layer CSS on top of it?
> 
> Because the input to a CSS processor is a document and a stylesheet. But
> the output of the transformation 

The XSL transformation, I assume

> is an *already formatted document* 

No; it is a formatting specification, which is then passed to a
formatter.

> with *no stylesheet*. 

Not necessarily; particularly for those misguided souls (IMHO) who think
that HTML is a layout language and are thus emitting HTML rather than
FOs.

> Since the transformation part of XSL knows nothing about
> CSS, I'm not clear how it would generate the CSS stylesheet.

It could generate a link to one; or it could generate a CDATA marked
section containing one; or (if emitting HTML) it could generate style
attributes just as easily as any other random attribute.

> I mean sure, if I'm implementing XSL on the server side then I might
> generate XML with a known set of element types and use a pre-written CSS
> stylesheet. That's a fine idea. 

I agree.

> But if it's on the client side, where does
> the CSS stylesheet come from? Do I now ship an XML document AND an XSL
> spec. AND a CSS stylesheet?

That is one possibility. More likely you would ship an XML document and
link to the XSL stylesheet which, if used and executed would produce
some output which would in turn contasin links to other resources -
inline images, audio files, CSS stylesheets, more XSL stylesheets -
whatever.

> > What is it about XML that encourages the development of standards which
> > mash together multiple layers of processing?  Why not keep transformation
> > in one box, and formatting in the other, and let people who need both just
> > use both layers?
> 
> That's exactly what the XSL spec does. There are two parts of the spec.
> and they can be implemented independently.

I don't see that explicitly mentioned in the spec (but am not online
just now so unable to check).
I can see how to implement the transformation opart without the FO part;
I can't see how to implement the FO part without also implementing the
transformation part.

> Sure, there may be good reasons
> to have them as two different specs, but don't pretend that the XSL spec.
> mashes them together. It very explicitly does not.

It does in some ways; xml is transformed to a tree of FOs rather than
xml being transformed to derived xml which is then (optionally)
decorated in a second step, as in CSS. But I agree that the spec does
carefully distinguish between the transformation part and the styling
target (one of the things that can be transformed into).

> It would be great to make it easier to move from one to the other.

Agreed

> Standardizing the formatting model is one step. 

Yes

> Writing CSS to XSL
> conversion scripts is a second. 

So, one programmer week, huh? How long do you think it would take in
elapsed time from the release of the next XSL draft to the release of
such a converter?

Actually I am more interested in seeing a different sort of converter -
one that renders a FO tree (not HTML, an XSL FO tree). Since, you know,
XSL is supposed to be a style sheet language.

--
Chris



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread