Skip Headers

# XPath by Position

Previous

Next

In a relational database table, columns are uniquely identified by name. In an XML document, elements are uniquely identified by name and position. Figure: Mapping to an XML Document by Position illustrates mapping to an XML document in which the first instance of the `street` element stores apartment information and the second instance of the `street` element stores street information. Figure: Mapping to an XML Document by Position shows that TopLink XML mappings preserve the order in which mappings are persisted and allow you to map Java object attributes to XML elements by position using an XPath like `street[2]/text()`.

Other XML technologies only recognize the name of XML elements (not their position) and force you to store the simple values from elements with the same name in a collection.

Mapping to an XML Document by Position

Description of "Mapping to an XML Document by Position"