XML Schema key Element
Complete XML Schema Reference Manual
Definition and Usage
The key element specifies that an attribute or element value (or a set of values) must be a key within a specified scope. The scope of a key is the containing element in the instance document. A key means that the data should be unique, non-zero, and always present within the specified scope.
The key element must contain the following elements in order:
Element Information
- Parent elements: element
Syntax
id=ID name=NCName any attributes (annotation?,(selector,field+)) (The ? symbol declares that within the key element, the element can appear zero or one time; the + symbol declares that the element must appear one or more times.)
property
Description
id
Optional. Specifies a unique ID for the element.
name
Required. Specifies the name of the key element.
any attributes
Optional. Specifies any other attributes with a non-schema namespace.
Complete XML Schema Reference Manual