Re: From CSS to DSSSL

[Paul Prescod:]

| >   (define (expt b n)
| >     (if (= n 0)
| >         1
| >         (* b (expt b (- n 1)))))
| 
| But when's the last time you wrote a function for exponentiation in a
| stylesheet?

I did this in the first stylesheet I wrote, the one for HTML.  This is
how you get the same scaling from one level of heading to the next
(e.g. H2 to H3) when everything in the document is calculated from the
size of the body text.  The ability to pull a function out of your hat
is one of the things I like best about DSSSL, even though I complain
about how hard it is.  The current version of my HTML 3.2 stylesheet
for print output is at

   http://sunsite.unc.edu/pub/sun-info/standards/dsssl/stylesheets/html32/html32hc.dsl

It uses ad hoc functions quite a bit, including ones to parse unit
values out of size attributes, for example.

[...]
| On the other hand, if I tried to make it the most *flexible* table
| code in the world, taking tables with 100 different attributes and
| cells and guessing what to do with them, *that's* when the code would
| get hairy.  But that's still not DSSSL's difficulty, that's the
| difficulty of the problem. Just figuring out what the browsers do with
| tables could take you a full day, much less coding something like it.

Yes, that was my point.  CSS is much simpler in areas like this
because it's just modifying some very complex behavior that's already
being taken care of by the browser, whereas in DSSSL you are
specifying the entire processing model.

It is true that my experience has been heavily colored by the kind of
markup I've been attempting to deal with -- HTML 3.2, DocBook, and the
DTD used to mark up the XML spec.  In every case I've been concerned
with proving that DSSSL can handle the hard stuff, and I've done very
little exploration of how well it would work with the kind of one-off
stylesheets that I think of as the natural domain of CSS.  I will be
very interested to see the results of your experiments in this
direction.

Procedural note: I think that it's inappropriate to take comments made
as part of an ongoing discussion in one place and cross-post them out
of context into another forum, especially when that forum is devoted
to a different purpose.  I have replied using the same cross-posting
because I felt that I had to, but I strongly object to this and hope
that the cross-posting can stop with this message.

Jon

Received on Friday, 18 April 1997 02:54:54 UTC