O'Reilly logo

Enterprise Application Integration With XML and Java™ by Bill la Forge, JP Morgenthal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6.6. Modeling Relationships

Much of the power and complexity of mapping data to XML comes from mapping the relationships between pieces of data. In the relational world, this equates to the modeling of primary-foreign key relationships. Let's look at each in turn.

6.6.1. Primary Keys

A primary key provides a unique value by which a single row of a particular table may be accessed. XML has a similar concept of an ID attribute that provides unique access to an element. Many implementations of DOM provide indexed access to such elements, so leveraging the similarities is often desirable. However, a subtlety arises: XML IDs must be unique across the whole document, but a primary key is unique only within that column.

To provide the necessary global ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required