xpath
function
Applies to: Databricks SQL Databricks Runtime
Returns values within the nodes of xml
that match xpath
.
Syntax
xpath(xml, xpath)
Arguments
xml
: A STRING expression of XML.xpath
: A STRING expression that is a well formed XPath.
Returns
An ARRAY of STRING.
The function raises an error if xml
or xpath
are malformed.
Examples
> SELECT xpath('<a><b>b1</b><b>b2</b><b>b3</b><c>c1</c><c>c2</c></a>','a/b/text()');
[b1, b2, b3]
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for