Re: Error in validator?

emeyer@netscape.com (Eric Meyer) wrote:

>    Anyway, a teammate has uncovered what we're pretty sure is a bug in 
> validator centered on the case of ID names.  I've created a simple test 
> page:
> 
>    <URL:http://www.meyerweb.com/eric/tests/val-casetest.html>
> 
> 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.

[1] http://www.w3.org/TR/html401/struct/links.html#h-12.2.1

Regards,
-- 
Masayasu Ishikawa / mimasa@w3.org
W3C - World Wide Web Consortium

Received on Friday, 6 July 2001 04:46:34 UTC