XML Schema unique Element
Complete XML Schema Reference Manual
Definition and Usage
The unique element specifies that an attribute or element value (or a combination of attribute or element values) must be unique within a specified scope. The value must be unique or zero.
The unique element must contain the following elements in order:
- oselector element contains an XPath expression designating a set of elements in which the values specified by the field element must be unique. There must be one and only one selector element.
- Each field element contains an XPath expression designating a value (attribute or element value) that must be unique within the set of elements specified by the selector element.
If there are multiple field elements, the combination of field elements must be unique. In this case, the value of a single field element need not be unique for the selected elements, but the combination of all fields must be unique.
There must be one or more field elements.
Element Information
- Parent elements: element
Syntax
id=ID name=NCName any attributes (annotation?,(selector,field+)) (The ? symbol declares that within the unique element, the element can appear zero or one time.)
property
Description
id
Optional. Specifies a unique ID for the element.
name
Required. Specifies a name for the element.
any attributes
Optional. Specifies any other attributes with a non-schema namespace.
Complete XML Schema Reference Manual