The DBMS_XMLDOM system package is used to access XMLType objects and implement the Document Object Model (DOM), an Application Programming Interface (API) for HTML and XML documents. The DOM defines the logical structure of a document, as well as the ways in which the document can be accessed and manipulated.
In the DOM specification, the term "document" is used in a broad sense: XML can represent a wide variety of information stored in different systems. This information is traditionally considered data, but it is still presented in a document format.
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 system package is available starting with OceanBase Database V4.4.2 BP2.
DBMS_XMLDOM Privileges
The EXECUTE privilege on the DBMS_XMLDOM system package is granted to PUBLIC. The current user has the privilege to use the subprograms within this package.
Considerations
After obtaining a DBMS_XMLDOM.DOMDOCUMENT handle through DBMS_XMLPARSER, you can use the subprograms in this package to traverse the DOM tree and read element and node values. For the complete parsing and release process, see Usage notes for DBMS_XMLPARSER.
The typical processing flow is as follows:
- Complete parsing according to the usage notes for DBMS_XMLPARSER and obtain the
DBMS_XMLDOM.DOMDOCUMENThandle. - Use
GETELEMENTSBYTAGNAME,ITEM,GETLENGTH, and other subprograms to traverse nodes. - Use
GETNODEVALUEto read node values. - Call
FREEDOCUMENTto release document resources.
The DBMS_XMLDOM subprograms supported by the current version of OceanBase Database are primarily used for read-only traversal and querying. For more information, see Overview of DBMS_XMLDOM Subprograms below.
For information about creating and converting XMLType objects, see XMLType overview.
Overview of DBMS_XMLDOM Subprograms
The following table describes the DBMS_XMLDOM subprograms supported by the current version of OceanBase Database and provides brief descriptions.
Subprogram |
Description |
|---|---|
| DOMDOCUMENT | Identifies the XML document. |
| DOMNODE | Identifies a DOM node. |
| DOMNODELIST | Identifies a node list |
| FREEDOCUMENT | Releases the DOM document |
| GETCHILDNODES | Obtains the list of child nodes |
| GETELEMENTSBYTAGNAME | Obtains elements by tag name (name='*' matches any element) |
| GETLENGTH | Obtains the number of nodes |
| GETNODEVALUE | Obtains the node value |
| ITEM | Obtains a node by index |
