DOMDOCUMENT represents an opaque handle to the entire parsed XML document, used as a document-level input parameter for APIs such as GETELEMENTSBYTAGNAME and FREEDOCUMENT. An opaque type indicates a reference object to a parsed XML document, used only for passing data into or out of DOM-related APIs, and does not allow direct access to its internal structure.
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
doc DBMS_XMLDOM.DOMDOCUMENT;
Parameters
Parameters |
Explanation |
|---|---|
| doc | Document handle. |
Return value
Document handle.
Usage instructions
DBMS_XMLDOM.DOMDOCUMENT is typically returned by DBMS_XMLPARSER.GETDOCUMENT and cannot be constructed directly.
Related subprograms
Subprogram |
Note |
|---|---|
| GETELEMENTSBYTAGNAME | Retrieves all matching element nodes from the entire XML document based on the tag name. This method requires passing inDOMDOCUMENTA document handle of the specified type as the input parameter. |
| FREEDOCUMENT | Release byDOMDOCUMENTThe type handles the XML document resources identified by the handle to prevent resource leaks. When using it, pass the document handle to be released as an input parameter. |
Examples
This example uses the DBMS_XMLPARSER system package to parse an XML document and obtain a DOMDocument handle, and then releases the document resources using the DBMS_XMLDOM system package:
-- Declare parser and document handle variables
DECLARE
p DBMS_XMLPARSER.PARSER;
doc DBMS_XMLDOM.DOMDOCUMENT;
BEGIN
-- Create a parser instance
p := DBMS_XMLPARSER.NEWPARSER;
-- Parse the XML document in the parser.
DBMS_XMLPARSER.PARSECLOB(p, '<root/>');
-- Get the DOMDocument handle of an XML document
doc := DBMS_XMLPARSER.GETDOCUMENT(p);
-- Release parser instance
DBMS_XMLPARSER.FREEPARSER(p);
-- Release XML Document Resources
DBMS_XMLDOM.FREEDOCUMENT(doc);
END;
/
