Re: Tag Soup (was: FW: XHTML)

On Mon, 6 Dec 1999, Daniel Hiester wrote:

> But those are doctype declations for html, not xhtml.

The doctype declaration is an SGML category.  There's no such thing as a
'HTML doctype declaration' or a 'xhtml doctype declaration'.  The fact of
the matter is that the doctype declarations produced by Frontpage,
Composer et al are utterly bogus - to impress the natives, I suppose.

> Forgive me if I misunderstand, but I thought XML documents had to be
> well-formed [...] I also thought that part of a document being
> well-formed is it having a doctype declaration... Am I mistaken?

Yes.  WF does not require a doctype declaration.  The WebSGML TC to ISO
8879 has made doctype declarations optional - omissible where they aren't
needed.

The doctype declaration serves two syntactic purposes in the SGML parse of
a document - to incorporate the contents of the DTD (various declarations
and PIs) and to identify the top-level element.  The contents of the DTD
matter for things like minimization, default values, notations, and the
referents of entity references.  If the instance doesn't need any of these
- all tags present, no notations invoked, no entity references used etc -
then that's the same thing as "saying" that the contents of the DTD are
empty and the top-level element is already explicitly evident.  That's why
the doctype declaration can be left out in certain applications.

Unfortunately, there seems to be a mythology in which the doctype
declaration is supposed to serve semantic purposes, such as "identifying"
versions or fixing meanings.  There's no basis for such voodoo in ISO8879
or the TCs.


Arjun

Received on Monday, 6 December 1999 23:17:05 UTC