Re: HTML ID case question

On Thu, 12 Jul 2001, Eric Meyer wrote:

> Steven Pemberton wrote:
> 
> >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!
> >
>    Ah, I see it now.  It's icky, but as you say, there it is, and if one 
> splits the right hairs you get such a result.  (Not that I mean to 
> criticize, since one must often split hairs to interpret specifications, 
> and I've done so many times in the past while working with CSS.)  Still, 
> I'd like to VERY strongly recommend that this error get an 
> "explanation..." link in the validator results.  The link can point 
> straight to the 12.2.1 of HTML 4, that's fine, just so long as it points 
> somewhere that authors can use to understand how and why IDs (which are 
> claimed to be case-sensitive in one place) can cause trouble when 
> there's a case-insensitive match.

Quick (possibly useful) analogies for an explanation here:

consider filename conventions on MacOS, where case is preserved but
there are similar problems that would involve case-insensitive
matches. (Sticking MacOS on top of the unix filesystem in MacOS X
produced a number of contortions.)

http://www.arstechnica.com/reviews/2q00/macos-qna/macos-x-qa-3.html


or consider use of Apache's mod_speling, and similar pitfalls in use
with directories or files named the same bar case; which one should
mod_speling match a misspelt request to?

http://httpd.apache.org/docs/mod/mod_speling.html

In all cases, providing case-insensitive matches is best avoided.

L.

<L.Wood@surrey.ac.uk>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>

Received on Thursday, 12 July 2001 13:10:34 UTC