Simplified XPath Syntax

When using an XPath expression to generate records from an XML document, use a simplified version of the abbreviated XPath syntax.

Use the abbreviated XPath syntax with the following restrictions:
Operators and XPath functions
Do not use operators or XPath functions in the XPath expression.
Axis selectors
Use only the single slash ( / ) child selector. The descendant-or-self double slash selector ( // ) is not supported.
Node tests
Only node name tests are supported. Note the following details:
  • You can use namespaces with node names, defined with an XPath namespace prefix. For more information, see Using XPath Expressions with Namespaces.
  • Do not use namespaces for attributes.
  • Elements can include predicates.
Predicates
  • You can use the position predicate or attribute value predicate with elements, not both.
  • Use the following syntax to specify a position predicate:
    /<element>[<position number>]
  • Use the following syntax to specify an attribute value predicate:
    /<element>[@<attribute name>='<attribute value>']
  • You can use the asterisk wildcard as the attribute value. Surround the value in single quotation marks.
For more information, see Predicates in XPath Expressions.
Wildcard character
You can use the asterisk ( * ) to represent a single element, as follows:
/root/*/msg
You can also use the asterisk to represent any attribute value. Use the asterisk to represent the entire value, as follows:
/root/info[@attribute='*']/msg