Re: CSS and SGML document formatting -Reply
> | What I would want as both an implementor and a web author is some style
> | sheet language which fit naturally within the syntax of HTML. I would
> | probably not be happy with DSSSL having a lisp syntax (although I
> | haven't any problems with it myself). Why can't a style sheet look more
> | like:
> | <STYLE CLASS=ABSTRACT.PARAGRAPH
> | SPACE-BEFORE="10 POINTS"
> | SPACE-AFTER="20 POINTS"
> | START-INDENT="5 EN"
> | KEEP-WITH-PREVIOUS>
> | What is the necessity to set the style declarations off in something
> | which requires a separate lexer and parser? You could still store
> | the entire style sheet in a URL and load it once per. set of pages
> | which use the particular style sheet.
For something like CSS, this would not have been unreasonable. As long as the
values of the properties are simple, and there is no nesting of properties
(i.e., what font should I use for my text-before?). For DSSSL, this approach
was considered and rejected. The main reason to reject it is ugliness. Unlike
CSS, DSSSL is a full-blown programming language. SGML is many things, but a
programming language it is not.
In terms of the approach you outline, check out Jon Bosak's last posting on what
he's done with EBT's DynaText stylesheet language, where this approach has been
taken. In terms of its utility as a stylesheet language for SGML, EBT's
language falls somewhere between CSS and DSSSL. Most of the intractable
limitations that it has have been solved in DSSSL. If anyone is interested in
pursuing this discussion further, please contact me.
Electronic Book Technologies, Inc.
> That's a question I wondered about, too. Why not just create a
> DTD for stylesheets, like
> STYLE (RULE*)
> TYPE CDATA
> RULE (PROPERTY*)
> ELEMENTS CDATA
> CONTEXT CDATA
> PROPERTY CDATA
> WEIGHT (important|legal|normal)
> giving (for bits of the HTML 2.0 sample in the CSS1 spec):
> <RULE elements=BODY>
> <PROPERTY> margin=1em
> <PROPERTY> font-family=serif
> <RULE elements="H1,H2,H3,H4">
> <RULE elements="IMG" context="A:link">
> <PROPERTY> border-color=red
> Or even create separate elements under RULE for each property, as in
> your example.
> I don't know the answer. Naming and character restrictions might have
> been an issue. The extra bulk of the SGML notation might have been an
> issue. Maybe the authors would like to comment.