XML Schema 参考手册 完整 XML Schema 参考手册 The key element specifies that an attribute or element value (or set of values) must be a key within the specified range. The scope of the key is the containing element in the instance document. The key means that the data should be unique, non-zero, and always exist within the specified range. The key element must contain the following elements in order: The selector element contains an XPath expression that specifies a set of elements in which the value specified by field must be unique. 父元素: Element (? The symbol declares that in the key element, the element can appear zero or once, and the + symbol declares that the element must appear one or more times. ) Attribute Description Id Optional. Specifies the unique ID of the element. Name Necessary. Specifies the name of the key element. Any attributes Optional. Specifies any other attributes with the non-schema namespace.Definition and usage ¶
Element information ¶
Grammar ¶
<key
id=ID
name=NCName
*any attributes*
>
(annotation?,(selector,field+))
</key>