DOMNODELIST is a handle to an ordered collection of nodes, returned by methods such as GETCHILDNODES and GETELEMENTSBYTAGNAME. You can use GETLENGTH to obtain the number of nodes, and then access individual nodes by index using ITEM. This handle is opaque, representing a reference object for the parsed XML document. It is intended only for input/output to DOM-related APIs and cannot be used to directly access its internal structure.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL-compatible mode.
Note
For V4.4.2, this type is available starting with OceanBase Database V4.4.2 BP2.
Syntax
nodelist DBMS_XMLDOM.DOMNODELIST;
Parameters
Parameters |
Explanation |
|---|---|
| nodelist | Handle of the node list. |
Description |
|
|---|---|
| keywords | |
| dir-name | |
| dir-name-en | |
| tenant-type | Oracle Mode |
| machine-translation | en |
| slug | domnodelist-oracle-compatible-mode |
DOMNODELIST is a handle to an ordered collection of nodes, returned by methods such as GETCHILDNODES and GETELEMENTSBYTAGNAME. You can use GETLENGTH to obtain the number of nodes, and then access individual nodes by index using ITEM. This handle is opaque.
Applicability
This content applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL-compatible mode.
Note
For V4.4.2, this type is available starting with OceanBase Database V4.4.2 BP2.
Syntax
nodelist DBMS_XMLDOM.DOMNODELIST;
Parameters
Parameter |
Description |
|---|---|
| nodelist | Node list handle. |
Return value
Node list handle.
Usage instructions
DOMNODELIST represents a sequence of DOMNODE references. When traversing, first call GETLENGTH to obtain the length, then use ITEM to access elements by index to prevent out-of-bounds errors.
Related subprograms
Subprogram |
Description |
|---|---|
| GETCHILDNODES | Returns the list of child nodes. This method requires passing inDOMNODEThe node handle of the specified type is used as the input parameter. |
| GETELEMENTSBYTAGNAME | Returns a list of matching elements. This method requires passing inDOMNODEThe node handle of the specified type is used as the input parameter. |
| GETLENGTH | Returns the length of the list. This method requires passing inDOMNODELISTHandle of the node list of the specified type as the input parameter. |
| ITEM | Fetch a node by its index. This method requires passing in theDOMNODELISTThe node list handle and index of the specified type are used as input parameters. |
Examples
This example uses the DBMS_XMLPARSER system package to parse an XML document and obtain a DOMDOCUMENT handle, and then uses the DBMS_XMLDOM system package to obtain a DOMNODELIST handle for the XML document:
-- Declare parser and document handle variables
DECLARE
p DBMS_XMLPARSER.PARSER;
doc DBMS_XMLDOM.DOMDOCUMENT;
nl DBMS_XMLDOM.DOMNODELIST;
BEGIN
-- Create a parser instance.
p := DBMS_XMLPARSER.NEWPARSER;
-- Parse the XML document in the parser.
DBMS_XMLPARSER.PARSECLOB(p, '<root><x/><x/></root>');
-- Get the DOMDocument handle of an XML document.
doc := DBMS_XMLPARSER.GETDOCUMENT(p);
-- Release parser instance
DBMS_XMLPARSER.FREEPARSER(p);
-- Retrieve a list of all elements named "x" in an XML document
nl := DBMS_XMLDOM.GETELEMENTSBYTAGNAME(doc, 'x');
-- Release XML document resources
DBMS_XMLDOM.FREEDOCUMENT(doc);
END;
/
