Purpose
The EXISTSNODE function checks whether a node exists at the specified XPath path in the XML variable.
Syntax
EXISTSNODE(XMLType_instance, XPath_string [, namespace_string ])
Parameters
| Field | Description |
|---|---|
| XML_Type_instance | The input XML variable. |
| XPath_string | The XPath path string. |
| namespace_string | The default prefix mapping or namespace mapping (optional). |
Return type
- Returns 1 if the node exists at the specified XPath path.
- Returns 0 if the node does not exist at the specified XPath path.
Examples
Parse an XML string and check whether a node exists at the specified XPath path.
obclient> select existsnode(xmltype('<a><b>aaa</b><b>bbb</b></a>'), 'a/b');
