xs:unique
<xs:unique id = "ID
" name = "NCName
" > <!-- (xs:annotation?, xs:selector, xs:field+ ) --> </xs:unique>
The xs:unique
element
requires that a specified subset of elements and/or attributes in
the instance document have unique values calculated from each of
those elements/attributes. This is similar to the constraint
imposed by declaring an attribute to have type xs:ID
, but it is much more flexible. The
xs:selector
child element uses
XPath to specify the subset of nodes from the instance document
over which uniqueness is calculated. The xs:field
children use XPath expressions
to specify what properties of those nodes must be unique within
the subset.