Re: Options for dealing with IDs

Steven Pemberton wrote:
> From: "Robin Berjon" <>
>>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
> 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 <>
Research Engineer, Expway
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488

Received on Tuesday, 21 January 2003 06:44:51 UTC