XML Schema key 元素

定義和用法
key 元素指定屬性或元素值(或一組值)必須是指定範圍內的鍵。鍵的範圍為實例文檔中的包含 element。鍵意味著數據在指定範圍內應是唯一的、不為零的並且始終存在的。
key 元素必須按順序包含下列元素:
- selector 元素包含一個 XPath 運算式,該運算式指定一個元素集,在元素集中,field 指定的值必須是唯一的。
元素資訊
- 父元素: element
語法
<key
id=ID
name=NCName
any attributes
>
(annotation?,(selector,field+))
</key>
id=ID
name=NCName
any attributes
>
(annotation?,(selector,field+))
</key>
(? 符號聲明在 key 元素中,元素可出現零次或一次,+ 符號聲明元素必須出現一次或多次。)
屬性 | 描述 |
---|---|
id | 可選。規定該元素的唯一的 ID。 |
name | 必需。規定 key 元素的名稱。 |
any attributes | 可選。規定帶有 non-schema 命名空間的任何其他屬性。 |
