Re: HTML Scalability

Joe English (joe@trystero.art.com)
Mon, 23 Jan 95 13:17:08 EST

[forwarded from sgml-internet to html-wg]

Dave Raggett <dsr@hplb.hpl.hp.com> wrote:
> What about this, though?
>
> <!ELEMENT div2 - - (h2, (division-content-stuff)*) -- a headed division -->
> <!ELEMENT h2 O O (title-content-stuff)* -- a headed division title -->
>
> Existing documents don't use div2 and never omit tags for headers.
> The DTD would have to make divisions optional, but this could be
> enforced with a stronger version of the DTD, perhaps via a marked
> section flag like %HTML.Recommended.

I think this would work.

Some other options to consider:

Define a single recursive <DIV> element instead of multiple <DIVn>s --

<!element div - - (%body.content;)>

and changing body.content to include DIV:

<!entity % body.content "(%heading|%block|HR|ADDRESS|DIV)*">

I don't think much is gained by having distinct elements
for different division levels, other than making end-tag omission
possible. Ranked section elements can make maintenance difficult --
changing a deeply nested <DIV1> to a <DIV2> and updating all its
descendants can be painful.

There are cases where you might want a division without a heading
(e.g., many of the things people are using <CENTER> for now), which
is why the <DIV> content model is just (%body.content;).

A scheme I've been using for my own DTDs looks something like:

<!element section - O (heading, (%body.content;)*, subsecs?)>
<!element subsecs - - (section+)>

I've found this to be the easiest to maintain: you don't have
to keep track of </section> end-tags or level numbers. This
might be too restrictive a content model for HTML 3, though,
since HTML should be flexible enough to represent any document
structure. (Maybe adding SUBSECS to %body.content; would work?)

It might be useful to make a distinction between "hierarchical
divisions" that represent the primary document hierarchy and
"containing divisions" that are general-purpose containers,
as in IBM ID Doc. Something like:

<!element SECT - - ((H1|H2|H3|H4|H5|H6), (%body.content;)
-- hierarchical division -- >
<!element DIV - - ((%body.content;)
-- containing division -- >

<!entity % body.content "(%heading|%block|HR|ADDRESS|DIV|SECT)*">

<SECT>s must begin with a heading, but <DIV>s are unrestricted.
If the "level" of a section is a useful thing to know, it could
be determined by the level of the first heading element.

--Joe English

joe@trystero.art.com