W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2008

RE: Uniqueness

From: Michael Kay <mike@saxonica.com>
Date: Thu, 17 Jan 2008 09:08:44 -0000
To: "'Dutta, Abhijit'" <abhijit.dutta@logicacmg.com>, <xmlschema-dev@w3.org>
Message-ID: <005001c858e8$90544d40$6501a8c0@turtle>

Is there a way in XSD to specify that the name and index will be unique for
a set of fields? If so, could you please give an example..


You can use xs:unique. But exactly how you use it depends on having a
clearer specification. Are you saying "name must be unique and index must
also be unique", or are you saying "the combination of name and index must
be unique" (the second option would allow two things to have the same name
provided they have a different index).


Also, uniqueness applies within some scope - typically there is some element
E within which each child/descendant element F has a unique value for V. You
need to tell us something about E, because that is where you define the


Michael Kay

Received on Thursday, 17 January 2008 09:09:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:45 UTC