Peter J Ross wrote:
>I've seen this page, that seems invalid to me. Doctype is incomplete
That's unusual, but the result seems to be that the validator treats
it as "strict".
It does and it must do so. The declaration
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
is correct in SGML terms. Quite apart from this, it violates the HTML 4.01
specification, which imposes the restriction that the URL string must be
present and must have a specific value; but this is not a formal requirement
in the sense that matters here.
I think it's also nice that the W3C validator takes "strict" as its
default.
It doesn't. The doctype explicitly specifies the Strict DTD, even though it
does not explicitly use the word "Strict".
The statement "This means that the resource in question identified itself as
'HTML 4.01 Strict'" is misleading. But the markup validator tries hard to be
useful to HTML authors, even though validation as such is nothing
HTML-specific. And it often tries too hard. The appropriate statement would
be that the SGML document that was submitted does not contain reportable
markup errors (in the SGML sense).
The W3C validator actually uses HTML 4.01 Transitional as the default, in a
sense, as you see if you try to validate markup via the direct input method
and type, say
<title>foo</title>
bar
You will then see rather confusing messages, headed by "Errors found while
checking this document as HTML 4.01 Transitional!", and yet one of the
messages says "no document type declaration; will parse without validation",
and then you get an error message about the string bar - which you would not
get if you really validated against HTML 4.01 Transitional.
The morale? Error recovery is often hard, and especially hard in a
validator. If you ask me, a validator should stop when it detects that no
doctype has been specified (in markup or with a command, or maybe with a
default), since validation without a doctype really doesn't make sense.
Yucca