W3C home > Mailing lists > Public > www-html@w3.org > May 2002

Re: Fragment identifiers and 'ID' attribute values: case matters

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Sun, 26 May 2002 03:32:46 +0200
To: "Etan Wexler" <ewexler@stickdog.com>
Cc: www-html@w3.org
Message-ID: <7rc0fucelubg616vbm7l869mcbnrht3pr8@4ax.com>
* Etan Wexler wrote:
>HTML4 has an SGML declaration that specifies that names fold to upper 
>case.  Consequently, an 'ID' attribute value specification of "AnElement" 
>produces the attribute value "ANELEMENT".

Thus the value of the id attribute in HTML 4 is case-insensitive. The
HTML 4 recommendation says, the value is case-sensitive. Either the
prose or the SGML declaration is in error in this case. I guess the
prose represents the intent of the working group, but it is not possible
to force an SGML processor to treat IDs case-sensitive, while treating
other names (entity names are the exception) case-insensitive, hence one
cannot require them to in the prose.

>Consequently, the correct 
>fragment identifier in a URI reference for an element with that 'ID' 
>attribute value specification is "#ANELEMENT", not "#AnElement".

Hm.

  <label for = foo>
  <label for = FOO>
  <label for = fOo>

all refer to the element with some id 'foo', since IDREFs are also
case-insensitive in HTML 4. The same could be said about the fragment
identifier and there would not be a problem. It does not matter in how
far case-insensitive matching has to be performed. The problem is the
name attribute value of some elements that also acts as anchor in HTML
documents. It's also described as case-sensitive in the prose. In
consequence this is an error. IDs and names are said to share the same
namespace, they cannot do so, if they do not have the same rules about
case-sensitivity.
Received on Saturday, 25 May 2002 21:33:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:51 GMT