Difference between xsd:key and xsd:unique

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

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

5条回答
  •  Happy的楠姐
    2021-01-04 10:56

    I found my own answer:

    It all has to do with cardinality:

    xsd:key is used for (0..N) and (1..1) multiplicity. xsd:unique is used for optional (0..1) multiplicity. This is also the reason why a the selected field in a xsd:unique can be nill.

    Source of my answer: http://www.xml.com/lpt/a/987

提交回复
热议问题