Messages for an Invalid DOCTYPE

(I'm not a list member; sorry about the parachuting in via
_Feedback_.)

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
    http://www.htmlhelp.org/tools/validator/doctype.html
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
    (explanation...)
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