XML Schema fieldElement


XML Schema 参考手册Complete XML Schema Reference Manual

Definition and Usage

The field element specifies an XPath expression that specifies the value (or one of the values) used to define identity constraints (unique, key, and keyref elements).

Element Information

  • Parent element: key, keyref, unique

Syntax

<field
id=ID
xpath=XPath expression
any attributes
>

(annotation?)

</field>

(The ? symbol declares that the element can occur zero or one time within the field element.)

Attributes Description
id Optional. Specifies a unique ID for this element.
xpath Required. Identifies a single element or attribute whose content or value is used for the constraint. If the expression identifies an element, the element must be of a simple type.
xml:lang Optional. Specifies the language used in the content.

Example 1

The following example shows a field element that defines the "userID" attribute as a field for identity constraints:

<xs:field xpath="@userID"/>


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