Purpose
The EXISTSNODE function determines whether the XML variable contains a node at the specified XPath path.
Syntax
EXISTSNODE(XMLType_instance, XPath_string [, namespace_string ])
Parameters
| Parameter | Description |
|---|---|
| XML_Type_instance | The XML variable. |
| XPath_string | The XPath path string. |
| namespace_string | The default namespace mapping or namespace mapping specified by a prefix (optional). |
Return value
- If the specified node exists, the function returns 1.
- If the specified node does not exist, the function returns 0.
Examples
Parse an XML string and determine whether it contains a specified node.
obclient> select existsnode(xmltype('<a><b>aaa</b><b>bbb</b></a>'), 'a/b');