Unique values

Going far beyond the DTD concept of using a special attribute type (the ID type) to uniquely identify a single element within the whole document, this standard allows a set of selected elements to form a group, within which each element must have a unique value somewhere within it, though not necessarily an attribute value, and possibly a combination of values.

Unique elements

The Unique element can appear at the end of an Element definition, after the optional ComplexType or SimpleType sub-element. If the test is to be applied to the whole document instance, then this element should be placed in the definition of the root element, as in the Book element definition here (placement elsewhere is discussed later):

 <element name="book"> ...

Get XML Companion, The, Third Edition 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.