2.9. Uniqueness and Keys

When you use XML to represent your application's data, you'll want the ability to specify uniqueness constraints similar to the concept of a primary key common in database technologies. XSD provides the <unique> element, which you can use to define uniqueness constraints on element or attribute values. The <unique> element contains a <selector> element that lets you specify a restricted XPath expression to indicate the scope of the uniqueness constraint. In the relational database analogy, this is similar to indicating the table on which you are defining the primary key. The <unique> element also contains one or more <field> elements that indicate which fields form the primary key. As in a relational database, the primary ...

Get Real World XML Web Services: For VB and VB .NET Developers 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.