W3C home > Mailing lists > Public > www-validator@w3.org > July 2001

Re: HTML ID case question

From: Steven Pemberton <steven.pemberton@cwi.nl>
Date: Wed, 11 Jul 2001 17:05:29 +0200
Message-ID: <024301c10a1a$edef6080$80f5a8c0@cwi.nl>
To: "Eric Meyer" <emeyer@netscape.com>, <beppe@netscape.com>
Cc: "HTML WG" <w3c-html-wg@w3.org>, <www-validator@w3.org>
From: "Eric Meyer" <emeyer@netscape.com>

Hi Eric!

>     In at least two places, the HTML 4.01 specification states that
> class and ID values are case-sensitive (7.5.2, 12.2.1), so these two IDs
> should not in fact be the same thing.

[...]

>     This is all important, of course, because Netscape 6 implements
> case-sensitive class and ID names.  My teammate and I feel that either
> the validator should be updated, so that authors aren't confused by it;
> or else the specification should be amended to make class and ID name
> case-insensitive.  Since that would require a change in the Netscape
> codebase, we really don't like the latter option.
>     So what it comes down to is that I'd like to know if the WG has a
> position, and if so what that position is.  If not, then we'd like to
> have the WG review the situation, and ideally issue a formal request (or
> whatever) to have the validator updated.  However, any ideas you might
> have about resolving this would be most appreciated.  Thanks!


Alright, well we discussed this today, and we do have a position, and the
good news is: nothing is broken, neither the spec, your code base, nor the
validator.

IDs are indeed case insensitive. And documents may not contain IDs that only
differ in case. That is what section 12.2.1 of HTML 4.01 says.
(http://www.w3.org/TR/html4/struct/links.html#h-12.2.1)

This means if you have a URL "#GoOn", then it may only reference an element
with id="GoOn", and not one with id="Goon" or id="goon".

However, a document may not contain elements where one has id="GoOn" and
another with id="Goon".

So the validator is allowed to complain about your test document, because it
has an id1 and an ID1, but you don't have to change your code base, and we
don't have to change our spec.

It is weird, but it's OK. No one has to fix anything!

Best wishes,

Steven
For the HTML WG
Received on Wednesday, 11 July 2001 11:07:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:13:59 GMT