W3C home > Mailing lists > Public > www-style@w3.org > April 1996

Re: CSS and SGML document formatting

From: Bert Bos <Bert.Bos@sophia.inria.fr>
Date: Thu, 25 Apr 1996 19:44:59 +0200
Message-Id: <199604251744.TAA26006@mygale.inria.fr>
To: www-style@w3.org
Gavin Nicol writes:
 > >| CSS is small, it's easy. Anybody can work with, or design something
 > >| like it. The one thing is is *not* is suitable as a general-purpose
 > >| stylesheet language for large scale publishing of structured
 > >| documents.
 > > 
 > >Part of the problem in trying to explain the limitations of CSS for
 > >generic SGML formatting is the lack of real-world examples.  I am
 > >working (slowly) on a set of typical cases drawn from actual online
 > >publications to show the kind of functionality that has to be in a
 > >stylesheet language that can handle the ordinary run of commercial
 > >typography.
 > 
 > I can provide an even simpler, though more profound reason, and I will
 > present it as a koan.
 > 
 >   What does foo.bar mean in CSS?

Ah, a puzzle!

1. The literal answer is probably not the answer the author is looking
for.

2. `foo' and `bar' are commonly used as placeholders for arbitrary
character strings.

3. The only clue is thus the dot (.)

4. A dot in CSS can occur in two contexts: to seperate an element and
a class, or as a decimal point.

5. Since `foo' and `bar' are seldom used to stand for numbers, let's
assume `foo' is an element and `bar' is a class.

6. There is a syntactical ambiguity in foo.bar, that has been solved
in a way that computer scientists may not like: by relying on the
presence of white space (foo.bar <> foo .bar). But computer science is
not `profound', so let's move on...

7. In the context of generic SGML, there is nothing special about an
element (unless whether it is in RCS or not, see below), so assume the
problem is with the class.

Answer 1: The class attribute is only present in HTML, not in `generic
SGML', but many other DTD's have in fact a similar attribute. The
dot-notation is therefore a shorthand for `foo [class=bar]' (to borrow
an earlier CSS syntax proposal). Of course, one can add a declaration
at the top of a CSS file that from now on `.' is a shorthand for
`type' instead of `class', as has actually been described in an
earlier version of CSS. This is another case where generality has been
dropped (momentarily?) in order to speed CSS acceptance.

Answer 2: Assuming it is the reliance on the Reference Concrete Syntax
that is the hidden meaning behind foo.bar, this, too, has been
addressed in the CSS spec. It is actually possible to use *any* syntax
(by using escapes), but only RCS will look nice.

One remaining problem: neither answer is very `profound'...


Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/pub/WWW/People/Bos/                      INRIA/W3C
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 93 65 77 71                 06902 Sophia Antipolis Cedex, France
Received on Thursday, 25 April 1996 13:45:05 GMT

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