XML Schema keyref element

Definition and usage

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

The keyref element must contain the following elements in order:

selector element:

There must be one and only one selector element.

selector element contains an XPath expression that specifies an element set in which the value specified by field must be unique.

field element

There must be one or more field elements.

Each field element contains an XPath expression that specifies a unique value (attribute or element value) for the element set specified by the selector element.

If there are multiple field elements, the combination of field elements must be unique. In this case, the value of a single field element for the selected element may not be unique, but the combination of all fields must be unique.

element information

number of appearances once
parent element element
content annotation、field、selector

gramma

<keyref
id=ID
name=NCName
refer=QName
any attributes
>
(annotation?,(selector,field+))
</include>

(? สัญลักษณ์ประกาศใน element key สามารถปรากฏขึ้นและไม่ปรากฏขึ้น ค่า + ประกาศให้ element ปรากฏขึ้นหนึ่งครั้งหรือหลายครั้ง)

คุณสมบัติ คำอธิบาย
id เลือกตั้ง กำหนด ID ที่เป็นเดียวกันกับองค์ประกอบนี้
name จำเป็น กำหนดชื่อ key element
refer จำเป็น กำหนดชื่อ key หรือ element unique ที่ถูกนิยามใน schema นี้ (หรือ schema ที่ชี้โดย namespace ที่กำหนด) ค่า refer จะต้องเป็น QName ประเภทสามารถรวมเนื้อหาชื่อชั้น
any attributes เลือกตั้ง กำหนดคุณสมบัติอื่นที่มีชื่อชั้น non-schema