Re: [VE][127] New Error Message Suggestion

On Fri, 29 Aug 2003, Dan Wood wrote:

> The attribute given above is required for an element that you've used,
> but you have omitted it. For instance, in most HTML and XHTML document
> types the "type" attribute is required on the "script" element and the
> "alt" attribute is required for the "img" element.  (The "alt" tag is
> required to provide a brief description of the image for those who are
> unable to view the image.  If the image has no real meaning, such as a
> line separator, specify an empty value with alt="".)

A brave attempt, but I think this is a good example where we get if a
validator starts trying to be "helpful" and "practical" beyond its sole
purpose, namely reporting mismatches between the document and the DTD.

The first sentence is probably OK, with "an" replaced by "the", though the
"you" format of addressing is somewhat questionable - a validator should
not chat with its user, and refer to what he has done, especially since it
might not be he who wrote the markup.

The best error message would something in the style "Missing required
attribute ... for element ...". People who do not understand what it means
should not use a validator before they learn that. There is no surrogate
for understanding the basics here. And if the base code of the validator
is such that the ...'s cannot be replaced by the appropriate attribute and
element names, then the message should be honestly abstract and generic:
"Missing required attribute for an element."

Anything you add to a simple statement of facts, concerning the sole job
of a validator, will just make thins worse. You start to argue and make
guesses, and people are guaranteed to misunderstand it, if you happen to
be right.

For example,

> For instance, in most HTML and XHTML document
> types the "type" attribute is required on the "script" element and the
> "alt" attribute is required for the "img" element.

Well, yes. But when it is true, the person who uses the validator should
already know this, or should know how to easily check it- otherwise his
use of a validator is just guesswork. When it is not true, well, it surely
confuses the user especially if there are such elements and attributes in
the actual document near the point of error.

> (The "alt" tag is
> required to provide a brief description of the image for those who are
> unable to view the image.  If the image has no real meaning, such as a
> line separator, specify an empty value with alt="".)

This has no place in a validator's report. It argues _why_ the DTD has
some rule. This is pointless. Worse still, such arguments are very often
wrong, and practically always at least partly wrong. It's not a tag, it's
not only for those who are unable to view the image, "real meaning" is
very obscure expression, and it is hardly adequate to give a _general_
rule that a "line separator" image - whatever that really means - shall
always have alt="". Worst of all, the statement that an alt attribute
specifies a _brief description_ is seriously wrong information, one of the
most common sources of (worse than) useless alt attributes.

You might disagree with some points in my analysis (though you would be
wrong). But the point is that when a validator tries to explain the
_reasons_ behind a DTD, it will go wrong, even after best attempts.
It would effectively argue why some syntax rule exists - but the only
sensible starting point is that the user _has already chosen_ to validate
the document against a DTD that has such a syntax rule.

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

Received on Saturday, 30 August 2003 02:00:55 UTC