RE: Uniqueness

 

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
constraint.

 

Michael Kay

http://www.saxonica.com/

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