Re: Error in validator?

Masayasu Ishikawa wrote:

>emeyer@netscape.com (Eric Meyer) wrote:
>
>>According to HTML 4.01, section 7.5.2, HTML ID (as well as class) names 
>>are case-sensitive, so this page shouldn't have triggered any errors. 
>> Or have I misunderstood some subtle interaction between specifications? 
>>
>
>Actually this is a known contradiction in the specification itself
>due to historical reason.  The former HTML Working Group which
>produced the original HTML 4.0 specification decided that names on
>anchors must be unique and case-sensitive, but defined that the 'id'
>attribute is of type ID, which means, according to the SGML declaration
>that specifies "NAMECASE GENERAL YES", upper case folding is to be done.
>
>This is indeed weird, and "12.2.1 Syntax of anchor names" [1]
>introduces further constraint on syntax of anchor names as follows:
>
>   An anchor name is the value of either the name or id attribute when
>   used in the context of anchors. Anchor names must observe the
>   following rules:
>
>     * Uniqueness: Anchor names must be unique within a document. Anchor
>       names that differ only in case may not appear in the same
>       document.
>     * String matching: Comparisons between fragment identifiers and
>       anchor names must be done by exact (case-sensitive) match.
>
>So it is not a bug in the validator to report errors for the 'id'
>attribute values that differ only in case.
>
That seems to me like an unacceptable behavior. The HTML specification, 
in section 7.5.2, clearly defines ID values to be case-sensitive, but 
the HTML validator complains about case-insensitive matches. As you 
point out, names are also defined to be case-sensitive. According to the 
specification (7.5.2, 12.2.1), ID and name values share the same 
namespace when it comes to anchors; the only way that can work is if ID 
and name share case-sensitivity rules. Given these facts, I would say 
that the described behavior should win out over whatever the DTD 
implies, because nearly everyone who read a specification read the 
English descriptions, not the DTD/grammar.
At any rate, either the specification needs to be clarified via an 
official errata so that IDs are made case-insensitive, or else the 
validator needs to fall in line with the language in the specification. 
At a bare minimum, there should be an "explanation..." link from this 
error message which points to the reasons behind it being given, so that 
authors can understand the error and make up their own minds about what 
they should do. This will at least remove the perception that the W3C is 
once again inconsistent in interpreting its own specifications.

-- 
Eric A. Meyer ......................... emeyer@netscape.com
Standards Evangelist .................. http://developer.netscape.com/
TE/DS Team, Netscape Communications ... http://www.netscape.com/
Try the new Netscape 6.1 Preview Release!
http://home.netscape.com/browsers/6/index61pr.html

Received on Friday, 6 July 2001 12:47:12 UTC