W3C home > Mailing lists > Public > www-validator@w3.org > March 2000

Messages for an Invalid DOCTYPE

From: Timothy A. McDaniel <tmcd@jump.net>
Date: Thu, 2 Mar 2000 18:41:33 -0500 (EST)
Message-Id: <200003022341.RAA15993@serv1.jump.net>
To: www-validator@w3.org
(I'm not a list member; sorry about the parachuting in via

Someone was just complaining on comp.infosystems.www.authoring.html
about the output for his page.  He had an invalid DOCTYPE, where it
was all in uppercase rather than mixed-case ("3.2 FINAL" instead of
"3.2 Final").  (Hey, *I* thought HTML control elements were entirely
case-insensitive too.)  It generated four error messages which both of
us found to be incomprehensible (as I don't know the components of a
DOCTYPE directive).  Then it gave an error for almost every line of
his file.

I know that when I left off the DOCTYPE entirely, it had a good
message of the form
    Error: Missing DOCTYPE declaration at start of document (explanation...)
where "(explanation...)" was a link to
I think that if the DOCTYPE is present but invalid, the same link
ought to be provided.  That alone would help greatly, even if my other
suggestions are infeasible.

I also wonder whether it would be better for most users' purposes just
to say something like
    Error: DOCTYPE is not one of the valid values for an HTML file
rather than, I gather, try to mention the problem for each part of the
DOCTYPE.  (My uneduated guess is that each part is separate and
significant for a general SGML document, so this is not possible with
just the SGML parser as is.  If so, perhaps a validator wrapper could
check the DOCTYPE for HTML specifically, and only if it's valid pass
the document to the full SGML parser?)

If an invalid DOCTYPE produces errors for most or all the following
lines, even simple things like "<html>", I see no reason to report
them: it wastes server time and can further confuse the user.  If the
DOCTYPE is present but invalid, is it possible to just abort further
checking, or perhaps just flush all the further error messages?

The person complaining thought that, if the DOCTYPE be invalid, the
validator could lowercase it and compare it with the lowercased valid
versions, and give a more specific message in that case.  This seems
more work for less gain; if the list of valid DOCTYPEs is always
given, or a pointer to them, that should suffice.

Tim McDaniel is tmcd@jump.net; if that fail,
    tmcd@us.ibm.com is my work account.
Received on Thursday, 2 March 2000 18:51:15 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:26 UTC