HTML and SGML declaration

Terry Allen (
Tue, 21 Nov 1995 07:16:10 PST

Dan and I gave different answers to the question of whether an
HTML document may have a prepended SGML declaration. Dan pointed to
the following passage in RFC 1866:

| 3.3. HTML Public Text Identifiers
| To identify information as an HTML document conforming to this
| specification, each document must start with one of the following
| document type declarations.

and I had in mind ISO 8879 4.283:

"SGML document entity: The SGML entity that begins an SGML document
[as distinguished from SUBDOCs and text entities]. It contains,
at a minimum, an SGML declaration, a base document type declaration,
and the start and end (if not all) of a base document element."

It is not possible to override 4.283 in the HTML spec; some clarification
in a future version would be welcome to indicate that what 3.3 describes
as an "HTML document" is not an SGML document entity but rather that
portion of it which is to be served to a client. In other contexts one
might well prepend an SGML decl to this "HTML document" to make a valid
SGML document entity conforming to the HTML spec.


Terry Allen  (, Online Books Editor, Songline Studios
               affiliated with O'Reilly & Associates, Inc.   
A Davenport Group sponsor.  See
 "Laid across a map of the US, Indonesia would stretch from coast to coast."