Print

XPath

The XPath() function reads data from the given XML string for the provided xpath expression. If there are multiple nodes returned then only value from the first node is retrieved.

Syntax

XPath(xml,xpath);

Function arguments

  • xml – (String) XML string with data;
  • xpath – (String) xpath expression.

Return value

This function returns String.
It returns a result of the given xpath expression.

Examples

Example 1:
XPath() returns inner text from the first number tag inside the first invoice tag from an xml string stored in [XML] field.

XPath([XML], "/invoice/number");

Example 2:
XPath() returns a value of the number attribute from the first invoice tag from an xml string stored in [XML] field.

XPath([XML], "/invoice/@number");

Example 3:
XPath() returns inner text from price tag from the invoice tag with number attribute equal 1 from an xml string stored in [XML] field.

XPath([XML], "/invoice[@number='1']/price");
Czy artykuł był pomocny?
0 na 5 gwiazdek
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
How Can We Improve This Article?