Re: doctype placement

From: Earl Hood (ehood@hydra.acs.uci.edu)
Date: Mon, Jul 26 1999


Message-Id: <199907270015.RAA10088@medusa.acs.uci.edu>
To: "Brian Gilkison" <gilkison@one.net>
cc: www-validator@w3.org
Date: Mon, 26 Jul 1999 17:15:47 -0700
From: Earl Hood <ehood@hydra.acs.uci.edu>
Subject: Re: doctype placement 

On July 26, 1999 at 17:59, "Brian Gilkison" wrote:

> > I can't find anything in the HTML 4.0 spec to indicate that the
> > validator is doing the right thing.  In fact, when the subject came up
> > on the mhonarc list, its author cited the spec in his defense:
> 
> The author has cited the correct location in the spec, but he left out the
> details (what he is citing can be found at
> http://www.w3.org/TR/REC-html40/struct/global.html#h-7.1)

No I did not.

> >     7.1 Introduction to the structure of an HTML document
> >
> >     An HTML 4.0 document is composed of three parts:
> >     1. a line containing HTML version information,
> >     2. a declarative header section (delimited by the HEAD element),
> >     3. a body, which contains the document's actual content. The body
> >         may be implemented by the BODY element or the FRAMESET element.
> 
> Line 1 is, in fact, the <!DOCTYPE ...> definition itself
> (http://www.w3.org/TR/REC-html40/struct/global.html#version-info).

The spec does not say "line" it says "part".

> >     White space (spaces, newlines, tabs, and comments) may appear
> >     before or after each section. Sections 2 and 3 should be
------------------------^^^^^^^^^^^^
> >     delimited by the HTML element.
> 
> The fact that the spec indicates that sections 2 and 3 are delimited by the
> <HTML> element also implies that the <!DOCTYPE> comes first.  Farther down

It indicates that the doctype declaration comes before 2 and 3.

> the page (http://www.w3.org/TR/REC-html40/struct/global.html#h-7.3), the
> spec goes on to state, "After document type declaration, the remainder of an
> HTML document is contained by the HTML element."  Once again, indication
> that the DOCTYPE comes first.

Once indicating that the doctype declaration comes before the HTML element.

Again from the spec, with certain words emphasized:

    "White space (spaces, newlines, tabs, and *COMMENTS*) may appear
     *BEFORE* or after *EACH SECTION*."

> > >From where I stand, the validator is exhibiting a bug, and I'm not sure
> > what's involved in fixing it.
> 
> Still not a bug, no fixing needed :).  No offense toward the creators of
> MHonArc, but this is yet another instance of an HTML editor imposing what it
> thinks is good style, but is unfortunately, accomplished incorrectly.

This is another instance of someone not interpreting a specification
correctly.  No offense.

BTW, what mhonarc does is legal according to the SGML standard.  And no
where does the HTML spec state it deviates from the particular issue
mentioned here.

Since nsgmls (which the validator uses) does confirm the page is valid,
it implies that the validator pre-processing is doing something
incorrectly, which Russell has already pointed out the problem in a
separate message.

	--ewh