XML Schema keyrefElement


XML Schema 参考手册Complete XML Schema Reference Manual

Definition and Usage

The keyref element specifies that an attribute or element value (or a set of values) corresponds to the value of a specified key or unique element.

The keyref element must contain the following elements in order:

  • There must be one and only one selector element.
  • The selector element contains an XPath expression that specifies a set of elements, in which the values specified by field must be unique.

Element Information

  • Parent element: element

Syntax

<keyref
id=ID
name=NCName
refer=QName
any attributes
>

(annotation?,(selector,field+))

</include>

(The ? symbol declares that the element can appear zero or one time in the key element, and the + symbol declares that the element must appear one or more times.)

Attributes Description
id Optional. Specifies a unique ID for the element.
name Required. Specifies the name of the key element.
refer Required. Specifies the name of the key or unique element defined in this schema (or another schema indicated by the specified namespace). The refer value must be a qualified name (QName). The type can include a namespace prefix.
any attributes Optional. Specifies any other attributes with a non-schema namespace.


XML Schema 参考手册Complete XML Schema Reference Manual Other Extensions