The FREEDOCUMENT procedure releases a DOMDOCUMENT obtained through methods such as GETDOCUMENT, along with its associated DOM resources. After release, do not use the document handle or any references derived from it to avoid dangling references.
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 subprogram is available starting with OceanBase Database V4.4.2 BP2.
Syntax
DBMS_XMLDOM.freeDocument (
doc IN DBMS_XMLDOM.DOMDOCUMENT);
Parameters
Parameter |
Description |
|---|---|
| doc | The DBMS_XMLDOM.DOMDOCUMENT handle to release. |
Return value
No return value.
Usage instructions
After releasing a document, the application should avoid further use of that handle and its derived DBMS_XMLDOM.DOMNODE, DBMS_XMLDOM.DOMNODELIST references to prevent dangling accesses.
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 release the document resources:
-- 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;
/
