DOM Parsing in SQL

You don’t really need to perform many DOM operations in Oracle Database 11g—when you create an XMLType object, you can process it using XMLType and XQuery functions. However, there are some operations where you might need to use DOM processing. Let’s take a look at a few examples.

Retrieving and Creating a CDATA Section

This first example uses DBMS_XMLDOM (with alias XMLDOM) and DBMS_XMLPARSER (with alias XMLPARSER) to retrieve and create a new CDATA node (create_cdata.sql):

Listing 4-3 Creating a CDATA Section in SQL

declare  
l xml clob;
1 parser xmlparser.parser;
l domdocument xmldom.domdocument;
l domnode xmldom.domnode;
l domtnode xmldom.domnode;
l domfnode xmldom.domnode;
l domcnode xmldom.domnode; ...

Get Oracle Database 11g Building Oracle XML DB Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.