Difference between xsd:key and xsd:unique

后端 未结 5 1173
面向向阳花
面向向阳花 2021-01-04 10:32

What is the difference between using xsd:unique and xsd:key?

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 10:46

    xsd:unique does not require the field to exist for the selector. If the field exists, its value should be unique.

    xsd:key requires the field to exist for all selector results. Every element in the selector should have a key.

    Note that xsd:keyref is not a requirement for xsd:key, the xsd:key can be there withoug any xsd:keyref.

提交回复
热议问题