W3C home > Mailing lists > Public > www-tag@w3.org > January 2003

Re: Options for dealing with IDs

From: Robin Berjon <robin.berjon@expway.fr>
Date: Tue, 21 Jan 2003 12:44:13 +0100
Message-ID: <3E2D328D.2020303@expway.fr>
To: Steven Pemberton <Steven.Pemberton@cwi.nl>
CC: www-tag@w3.org

Steven Pemberton wrote:
> From: "Robin Berjon" <robin.berjon@expway.fr>
> 
>>What happens when a DTD declares attribute "name" to be of type ID and
>>it occurs on the same element as xml:id with a different id, in a validated
>>document?
> 
> I have never understood this restriction in XML. I understand the problem of
> having two elements with the same name, but not of having two names on one
> element.
> 
> Can anyone explain to me what breaks when an element has two (different)
> names? Why does XML prevent you from having more than one attribute of type
> ID on an element?

I do not know the exact reasons behind that decision, but it would seem to me 
that having a garanteed one-to-one mapping between name and element could have 
some value. That way you are certain to have no duplicate elements in a set of 
IDs. Whether or not that is more important than the ability to give an element 
two names probably depends on your application.

-- 
Robin Berjon <robin.berjon@expway.fr>
Research Engineer, Expway        http://expway.fr/
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488
Received on Tuesday, 21 January 2003 06:44:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:47:15 GMT