Reference and Uniqueness Constraints

The ID and IDREF datatypes from XML 1.0 provide a simple mechanism for uniquely identifying elements in a document and ensuring referential integrity for attributes (and elements if XML Schemas are in use) that refer to those elements. However, compared to the uniqueness and referential integrity constraints provided by most database technologies, ID and IDREF are extremely limited. The XML Schema specification outlines a mechanism for describing uniqueness and referential integrity constraints in terms of modified XPath expressions.

XML Schemas defines three constructs for specifying uniqueness and reference constraints. The unique construct is morally equivalent to a primary key constraint in a DBMS. The ...

Get Essential XML: Beyond Markup now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.