Constraints: Keys, Uniques, and KeyRefs (XSM)

Constraints indicate that element values must be unique within their specified scope. Constraints are only available in a model targeted with XSD.

Each constraint has two specific attributes: selector and field.

In a schema, a constraint is declared with its corresponding tag: <unique>, <key> or <keyRef>.

There are three kinds of identity constraints: