Category: XMLDB

January 15
December 7

Michael McLaughlin had written last week some nice small blog posts on XML DB. I couldn’t resist to see if I could make this one easier… 😉

The package DBMS_EPG is sole based on the xdbconfig.xml file, which is the configuration file for the XML DB Protocol Server, which is not, by the way, an Apache Server configured inside the database, but a custom build protocol server hook-in into the Oracle listener, that passes its data to the Shared Server SQL*Net Architecture.

So I made some attempts on my 11gR2 database, without using the nowadays “extract” deprecated functions… After fiddling around with the XMLTABLE function, using DBMS_XDB.CFG_GET() to get the content of the xdbconfig.xml XML document (its result is an xmltype datatype), the following simplified code that results the DAD’s in a varchar2(15) list.

SQL> SELECT u.dad as "PL/SQL DAD List"
  2  FROM   XMLTable(XMLNAMESPACES (
  3                                  default 'http://xmlns.oracle.com/xdb/xdbconfig.xsd'
  4                                ),
  5                  '//servlet-list/*[servlet-language="PL/SQL"]'
  6                  PASSING DBMS_XDB.CFG_GET()
  7                  COLUMNS DAD varchar2(15) PATH '/servlet/servlet-name/text()'
  8                 ) u
  9  ;

PL/SQL DAD List
---------------
APEX

1 row selected.

SQL>  EXECUTE dbms_epg.create_dad('MARCO','/XFiles/*');

PL/SQL procedure successfully completed.

SQL> SELECT u.dad as "PL/SQL DAD List"
  2  FROM   XMLTable(XMLNAMESPACES (
  3                                  default 'http://xmlns.oracle.com/xdb/xdbconfig.xsd'
  4                                ),
  5                  '//servlet-list/*[servlet-language="PL/SQL"]'
  6                  PASSING DBMS_XDB.CFG_GET()
  7                  COLUMNS DAD varchar2(15) PATH '/servlet/servlet-name/text()'
  8                 ) u
  9  ;

PL/SQL DAD List
---------------
APEX
MARCO

2 rows selected.
November 9

Apparently there is already a Early Adopter Release since september, but even so, I am very happy that the first XMLDB features are getting implemented. The readme describes the new feature for XMLDB as

  • XML Type tables are visible in the Connections navigator
  • XML Type columns data can be edited in Data tab

I tried it a bit and saw to my plesant surprise that it also provides, will provide, direct XDB Repository access to files and folders. Really cool. The first (small) mistake was also noticed by me, in the overview, describing an XML Schema as a datatype BLOB. Hint for the Oracle SQL Developer Team, a more descriptive, correct content type can be deducted from the XDB$RESOURCE table due to the fact that the content type/mime type will be display in this table (see also xdbresource.xsd) “purchaseOrder.xsd” as text/xml.

Look and feel regarding the editing of XMLType is a bit like Toad does it, at least in the Early Adapter version. Not a direct possibility to edit an XML document, but a extra window that pops-up before you get the option to edit the content.

Oracle SQL Developer 2.1 EA Release - XMLDB Features

Click on the picture to enlarge