Re: [VE][122] Error Message Feedback

On Sat, 16 Oct 2004, Bjoern Hoehrmann wrote:

> * Jukka K. Korpela wrote:
> >If you asked me, I would say that I find it strange that the validator
> >issues an error message about an attribute that is declared with a CDATA
> >value. I don't know what DTD is used; but in all published DTDs for
> >different versions of HTML, the name attribute of an <a> element is
> >declared CDATA.
>
> Some version of XHTML 1.x.

Pardon? Some version is/has/does what?

In XHTML 1.0, the name attribute for <a> is declared as NMTOKEN, so
I was mistaken. It's nasty that there is no adequate documentation
of the differences between HTML 4.01 and XHTML 1.0, and the XHTML 1.0
specification paints a rather misleading picture (it has a section
titled "Differences with HTML 4", which starts with a non-difference and
does not list many differences, like this one).

And in XHTML 1.1, there is no name attribute for <a>. So I think we have
managed in our detective work to find out what the original poster
was doing. He/she is using an XHTML 1.0 document type, and here it does
not matter which.
Hint: a URL would have made things much easier.

The solution is, naturally, to remove the quotation mark characters
from the attribute values. (It is irrelevant here whether they have been
written directly or using character references.) I would additionally
recommend using simpler syntax, as I mentioned before.

What puzzles me is that when I submitted a document to the validator
so that I have an XHTML DTD and the line
<h5><a name="_RCA_VICS_&#8216;PLUM &#8217;"></a>RCA VICS</h5>
(constructed on the basis of the original message, which lacked </h5>,
which probably appears elsewhere), I _also_ get, between the two messages
posted here,

Line 13, column 34: value of attribute "name" must be a single token

<h5><a name="_RCA_VICS_&#8216;PLUM &#8217;"></a>RCA VICS</h5>

with no character highlighted, but the column number should make it clear
that the report relates to the space after PLUM. Maybe the actual document
that the original poster tried to validate didn't contain that space, or
maybe he/she regarded this message as irrelevant or too incomprehensible.
Yet it is, in a sense, the most informative of the three.

I wonder why the validator does not report the errors in terms of actual
syntactic restriction imposed in a DTD. After all, a message like
  character "..." is not allowed in the value of attribute "name"
is rather abstract. It points to the right direction, but why doesn't it
say _why_ some character is not allowed? After all, the relevant thing is
that the attribute value must be a name token, not what its name happens
to be.

(I Cc'ed the original poster's address, since I think we should not expect
that people sending to this list have subscribed to it, especially due to
the mailto-links in the validator's reports.)

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

Received on Saturday, 16 October 2004 10:18:38 UTC