XML_EXTRACT
The XML_EXTRACT function extracts the XML nodes that are specified by an XPath expression.
Syntax
XML_EXTRACT(xmlfile, xpath_expression [ , separator])
where,
-
xmlfile is a fragment of XML markup.
-
xpath_expression is also known as a locator.
-
separator has a default value is a comma and is an optional argument.
Example
select xml_extract('<?xml version="1.0" standalone="no"?><emps><emp><interests><interest>i1</interest><interest>i2</interest><interest>i3</interest></interests></emp></emps>','/emps/emp/interests/interest/text()') a1from
{path1 as table1}
The above example extracts the value of /emps/emp/interests/interest node.