Latest web development tutorials

XML Schema unique element

XML Schema Reference Complete XML Schema Reference

Definition and Usage

unique element or elements specified attribute value (or a combination of attribute or element value) within the specified range must be unique. This value must be unique or zero.

unique sequence elements must contain the following elements:

  • oselector element contains an XPath expression that specifies a set of elements, in which the value specified by the field elements must be unique. There must be one and only one selector element.
  • Each field element contains an XPath expression that specifies the elements specified by the selector element sets must be unique in terms of value (attribute or element values).
    If there are multiple field elements, a combination of field elements must be unique. In this case, the value of a single field elements for the selected element is not necessarily unique, but the combination of all fields must be unique.
    There must be one or more field elements.

Element Information

  • Parent element: element

grammar

<unique
id=ID
name=NCName
any attributes
>

(annotation?,(selector,field+))

</unique>

(? Sign declares that the unique element of the element can occur zero or one time.)

属性 描述
id 可选。规定该元素的唯一的 ID。
name 必需。为该元素指定名称。
any attributes 可选。规定带有 non-schema 命名空间的任何其他属性。


XML Schema Reference Complete XML Schema Reference