]> Unsolved issues in SGML/HTML style sheets

Unsolved issues in SGML/HTML style sheets

There are two classes of problems regarding the style sheet language: styles that fit the model but that are difficult to implement because of the way typical window systems work, and styles that are needed but that don't seem to fit the model.

The `model' in this case is the mechanism of attaching local properties to SGML elements in the form of a static `rendering table'. For the first class of problems the question is mainly: can we do without this style and if not, can we specify it in such a way that applications can find alternative ways of displaying the data. For the second class of problems the question is how to extent the model with the least disruption.

Difficult styles that nevertheless fit the model

Rotated text

Titles or headers in a table might be displayed sideways or diagonally. If rotated text is allowed, then rotated rules should be allowed as well.

Large initials

Large initials, or `dropcaps', can be specified as a boolean (use them for this paragraph or not), as a size (so many sizes larger than the body text), as a combination of several styles (font family, style, size), etc. However, implementation is difficult for a number of reasons:

Styles for the first line of a paragraph

Related to the large initials is the style in which the whole first line of a paragraph is printed in capitals or larger than the rest. A variation of this is to enlarge only the first few words.

Styles that strain the model

Numbered list items and headers

Numbering items in a list is not difficult, but continuing the numbers in the next list is. Numbering headers without enclosing containers, as is possible in HTML, is also a problem, since H1, H2, 3tc, all need different counters. They even need to be combined: section 2.3, chapter 5A, etc. Counters must either be passed on from element to element via common ancestors, or all counters must be global.

Example with global counters:


with style:

*OL            : count2=0
*OL LI         : count2=count2+1, label=count2
*OL*OL         : count3=0
*OL*OL LI      : count3=count3+1, label=count2++"."++count3
*OL*OL*OL      : count4=0
*OL*OL*OL LI   : count4=coubt4+1, label=alpha(count4)
*OL*OL*OL*OL   : count5=0
*OL*OL*OL*OL LI: count5=count5+1, label=alpha(count4)++"-"++Roman(count5)


  1 Europe
      1.1 Germany
            a Köln
                 a-I Dom
                a-II Hauptbahnhof
            b Karlsruhe
      1.2 Norway
  2 Africa

Another use of global counters is when the page is printed with numbered footnotes.

(As the example shows, a sequential implementation must ensure that the counters are evaluated before the labels are formed.)

Captions above floating images

Since the width of the image isn't know when the caption is set, the width of the caption will have to be estimated. Another possibility is to use two passes: when the image is found, the width of the floating paragraph is fixed and the page is formatted again.

(Back) to style sheet overview

Bert Bos, 23 May 1995