Skip Headers

# XPath by Name

Previous

Next

For simple XML documents, TopLink XML mappings can correctly place data in an XML document given an XPath of only an attribute or element name.

Figure: Mapping to a Simple XML Document by Name illustrates mapping to a simple XML document by name. You can map Java object attribute `name` to XML attribute `name` by specifying an XPath of only `@NAME`. Similarly, you can map Java object attribute `age` to XML text node `AGE` by specifying an XPath of only `AGE`.

Mapping to a Simple XML Document by Name

Description of "Mapping to a Simple XML Document by Name"

Specifying an XPath by name provides the worst performance of the XPath mapping options. Oracle recommends that you use XPath by position (see "XPath by Position") or XPath by path and name (see "XPath by Path and Name") instead.