XPATH

The XPATH function queries the XML input.

This function queries the XML input, which is provided as a text stream or URL, by using the specified XPATH expression and context, returning the result of the evaluation.

Syntax:
XPATH (single-text-expression, single-text-expression, single-text-expression)
Meaning:
XPATH (xml_url_or_xml_fragment, xpath_expression, context_expression)
Returns:
A single text item

Examples

  • XPATH( "current://ipo.in.xml", "/ipo:purchaseOrders/order/items/item[1]/shipDate", "ipo http://www.example.com/IPO" )

    Returns the content of the shipDate element from the ipo.in.xml file.

  • XPATH( PACKAGE(source), "/ipo:purchaseOrders/order/items/item[1]/shipDate", "ipo http://www.example.com/IPO" )

    Returns the content of the shipDate element from the input XML fragment.