El Unique
# 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 empty.
The unique element must contain the following elements in order:
* The selector element contains an XPath expression specifying a set of elements within which the values specified by the field elements must be unique. There must be exactly one selector element.
* Each field element contains an XPath expression specifying the value (attribute or element value) that must be unique for 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 an individual field element does not need to 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 element:** element
### Syntax
(annotation?,(selector,field+))
(The ? symbol indicates that the element may appear zero or one time within the unique element.)
| Attribute | Description |
| --- | --- |
| id | Optional. Specifies a unique ID for this element. |
| name | Required. Specifies a name for this element. |
| any attributes | Optional. Specifies any additional attributes with non-schema namespaces. |
* * Complete XML Schema Reference Manual](#)
YouTip