Re: Toward Closure on HTML

Roy T. Fielding ([email protected])
Thu, 07 Apr 1994 12:09:09 -0700


Rob Raisch writes:

> ---------------------Example---------------------
> <body>
> This is text with no container. (1)
> <p>
> Perhaps this is text in a <p> container. (2)
> <p>
> Hmmm... no </p> associated with the previous <p>! Do we assume that there
> was to be one, or do we treat <p> as a break? (3)
> </body>
> -------------------------------------------------
>
> The principles behind SGML -- and by its lineage, HTML -- are to markup
> the structure of the document.
>
> In the previous example, what is the text associated with (1)? It is
> <body> text or <p> text?

It is <p> text contained within the <body>, as can be inferred by any
SGML (or just HTML+) parser.

> And if we build stylesheets which allow logical elements within the
> document to have their own stylistic "hints", which do we apply to (1)?

The default <p> style, naturally, since there must exist one for any such
scheme to be backward compatible. The default <p> style could be based
on the context (i.e. defined according to the current hierarchy of elements
which contain the paragraph) -- e.g. a nested list within a quotation would
have a particular default style. In fact, that is how existing clients
behave already (though it may not be their intention). Custom-styled
paragraphs would require the use of explicit <P>s.

BTW, your example would format something like this in HTML+:

---------------------Example---------------------
This is text with no container. (1)

Perhaps this is text in a

container. (2)

Hmmm... no

associated with the previous

! Do we assume that there was to be one, or do we treat

as a break? (3)
-------------------------------------------------

Granted, it would not look like that on existing clients, but then
people generally don't write malformed HTML on purpose and thus we
need not require clients to render malformed HTML consistently.

Cheers,

....Roy Fielding ICS Grad Student, University of California, Irvine USA
([email protected])
<A HREF="http://www.ics.uci.edu/dir/grad/Software/fielding">About Roy</A>