Re: HTML ID case question

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 UTC