Re: ID and NAME

=?iso-8859-1?Q?Martin_J=2E_D=FCrst?= (mduerst@ifi.unizh.ch)
Fri, 26 Sep 1997 13:49:39 +0200 (MET DST)


Date: Fri, 26 Sep 1997 13:49:39 +0200 (MET DST)
From: =?iso-8859-1?Q?Martin_J=2E_D=FCrst?= <mduerst@ifi.unizh.ch>
To: Peter Flynn <pflynn@imbolc.ucc.ie>
cc: www-html@w3.org
In-Reply-To: <199709252055.VAA05006@imbolc.ucc.ie>
Message-ID: <Pine.SUN.3.96.970926134250.361f-100000@enoshima>
Subject: Re: ID and NAME

On 25 Sep 1997, Peter Flynn wrote:

> MZ writes:
>    I know ID and NAME occupy the same namespace.
> 
> I thought the whole point about NAME was that it _didn't_ occupy
> the same namespace as ID. Unless someone's changed it recently.
> ID is declared as ID; NAME is CDATA last time I looked.
> 
>    <A NAME="fubar" ID="fubar">...
> 
> Perfectly OK, precisely because they _don't_ occupy the same
> namespace.

If you want to be exact, their namespaces overlap, for historical
reasons. It's impossible to declare ID as CDATA in SGML. However,
NAME has quite some deployed use with values other than those
very restricted ones allowed for ID. Also, ID is, from an SGML
viewpoint, case-insensitive (i.e. FUBAR would be the same as
fubar and FuBaR,...), where NAME traditionally and in all major
implementations is case-sensitive (shorter code :-).

This, together with the problems that case-sensitivity does not
easily scale in an international setting (German sz, Turkish
dotless i,...), let to the solution that:

- The namespaces are merged (but you can have names in NAME
	that you can't in ID)
- The names are case-sensitive (i.e. case matters)
- It is not allowed/suggested to use names that only differ
	in case, because this might give bad surprises
	(an SGML validator interprets them as being the same,
	and so barks if one element is ID=fubar and the other
	is ID=FUBAR, but some other application may find it
	fine).

That pretty much allows everybody to be happy :-).


Regards,	Martin.