XML Schema–based XMLType

By default, without specifying XML schemas, XMLTypes are non-XML-Schema-based XMLTypes. However, in some applications, you may wish to create an XML Schema–based XMLType to optimize the XMLType storage and enable XML Schema–aware operations. To create an XML Schema–based XMLType, you first need to register an XML schema (contact.xsd). The SQL command is shown as follows (register_xsd_bfile.sql):

Listing 2-6 Registering an XML Schema from BFILE

BEGIN

DBMS_XMLSCHEMA.registerSchema(‘http://xmlbook.com/sample/contact.xsd’, XMLType(bfilename(‘XML_DIR’,‘contact/contact.xsd’),nls_charset_id(‘AL32UTF8’)),

genTypes => FALSE,

genTables => FALSE,

options => DBMS_XMLSCHEMA.REGISTER_BINARYXML);

END;

/

This command registers an ...

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.