Skip Headers

# Configuring XPath

Previous

Next

TopLink uses XPath statements to map the attributes of a Java object to locations in an XML document. When you create an XML mapping or EIS mapping using XML records, you can specify the XPath based on any of the following:

- Name

- Position

- Path and name

Table: Mapping Support for XPath summarizes which mappings support this option.

Mapping Support for XPath

Mapping | Using TopLink Workbench | Using Java
--- | --- | ---
EIS Mappings Foot 1 |  |
EIS Direct Mapping |  |
EIS Composite Direct Collection Mapping |  |
EIS Composite Object Mapping Foot 2 |  |
EIS Composite Collection Mapping |  |
XML Mappings |  |
XML Direct Mapping |  |
XML Composite Direct Collection Mapping |  |
XML Composite Object Mapping Footref 2 |  |
XML Composite Collection Mapping |  |
XML Any Object Mapping |  |
XML Any Collection Mapping |  |

Footnote 1 When used with XML records only (see "Configuring Record Format").

Footnote 2 Supports the self XPath (".") so that the TopLink runtime performs all read and write operations in the parent's element and not an element nested within it (see "Mappings and the jaxb:class Customization").

Before you can select an XPath for a mapping, you must associate the descriptor with a schema context (see "Configuring Schema Context for an EIS Descriptor" or "Configuring Schema Context for an XML Descriptor").

For more information, see "Mappings and XPath".