Skip Headers

Oracle9i XML Database Developer's Guide - Oracle XML DB
Release 2 (9.2)

Part Number A96620-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page Go to next page
View PDF

G
Example Setup scripts. Oracle XML DB - Supplied XML Schemas

This appendix describes a few example setup scripts for use with the examples in Chapter 3, "Using Oracle XML DB". It also includes the structure of Resource View and Path View and the Oracle XML DB supplied XML schema:

Example Setup Scripts

The following sections include the setup scripts and sample files used for the examples in Chapter 3, "Using Oracle XML DB".

Chapter 3 Examples Set Up Script: Creating User and Directory

set echo on
connect / as sysdba
drop directory DIR;
drop user &1 cascade;
create user &1 identified by &2;
grant create any directory, drop any directory to &1;
grant connect, resource to &1;
connect &1/&2
create or replace function getFileContent(file bfile)
return CLOB deterministic
is
   charContent     CLOB := ' ';
   targetFile      bfile;
   warning         number;
begin
  targetFile := file;
  DBMS_LOB.fileopen(targetFile, DBMS_LOB.file_readonly);
  DBMS_LOB.loadfromFile(charContent,targetFile,
  DBMS_LOB.getLength(targetFile),1,1);
  DBMS_LOB.fileclose(targetFile);
  return charContent;
end;
/            
show errors;
drop directory DIR;
create directory DIR as '&3';
create or replace function getDocument(filename varchar2)
return CLOB deterministic
is
   file            bfile := bfilename('DIR',filename);
   charContent     CLOB := ' ';
   targetFile      bfile;
   warning         number;
begin
  targetFile := file;
  DBMS_LOB.fileopen(targetFile, DBMS_LOB.file_readonly);
  DBMS_LOB.loadfromFile(charContent,targetFile,
  DBMS_LOB.getLength(targetFile),1,1);
  DBMS_LOB.fileclose(targetFile);
  return charContent;
end;
/  
show errors
declare
  result boolean;
begin
  result := dbms_xdb.createfolder('/public/&4');
end;
/
commit;
quit

Chapter 3 Examples Set Up Script: Granting Privileges, Creating Table...

This script grants appropriate privileges, creates tables with XMLType Columns, creates XMLType tables, Inserts, queries, and updates the tables:

set echo on
connect scott/tiger
grant all on emp to &1;
connect &1/&2
--
-- Table Creation Examples
--
create table EXAMPLE1
(
 KEYVALUE  varchar2(10)  primary key,
     XMLCOLUMN xmltype
);
create table XMLTABLE of XMLType;
-- 
-- Insert Example
--
describe getDocument;
insert into XMLTABLE 
values (xmltype(getDocument('purchaseorder.xml')))
/
commit
/
--
-- Valid existsNode operations
--
select existsNode(value(X),'/PurchaseOrder/Reference') 
from XMLTABLE X
/
select existsNode(value(X),
                  '/PurchaseOrder[Reference="ADAMS-20011127121040988PST"]') 
from XMLTABLE X
/
select existsNode(value(X),
             '/PurchaseOrder/LineItems/LineItem[2]/Part[@Id="037429135020"]')  
from XMLTABLE X
/
select existsNode(value(X),
             '/PurchaseOrder/LineItems/LineItem[Description="8 1/2"]') 
from XMLTABLE X
/
--
-- Invalid existsNode() operations
--
select existsNode(value(X),'/PurchaseOrder/UserName') 
from XMLTABLE X
/
select existsNode(value(X),
                  '/PurchaseOrder[Reference="ADAMS-XXXXXXXXXXXXXXXXXXXX"]') 
from XMLTABLE X
/
select existsNode(value(X),
             '/PurchaseOrder/LineItems/LineItem[3]/Part[@Id="037429135020"]')  
from XMLTABLE X
/
select existsNode(value(X),
             '/PurchaseOrder/LineItems/LineItem[Description="Snow White"]')
from XMLTABLE X
/
--
-- existsNode() in where clause examples
--
select count(*) 
from XMLTABLE x
where existsNode(value(x),'/PurchaseOrder[User="ADAMS"]') = 1
/
delete from XMLTABLE x
where existsNode(value(x),'/PurchaseOrder[User="ADAMS"]') = 1
/
commit
/
--
-- Reload the Sample Document.
--
insert into XMLTABLE 
values (xmltype(getDocument('purchaseorder.xml')))
/
commit
/
--
-- Valid extractValue() operiations
--
select extractValue(value(x),'/PurchaseOrder/Reference')
from XMLTABLE X
/
select extractValue(value(x),
       '/PurchaseOrder/LineItems/LineItem[2]/Part/@Id') 
from XMLTABLE X
/
--
-- Invalid extractValue() operations
--
select extractValue(value(X),
                   '/PurchaseOrder/LineItems/LineItem/Description')
from XMLTABLE X
/
select extractValue(value(X),
                   '/PurchaseOrder/LineItems/LineItem[1]')
from XMLTABLE X
/
select extractValue(value(x),'/PurchaseOrder/Reference')
from XMLTABLE X, SCOTT.EMP 
where extractValue(value(x),'/PurchaseOrder/User') = EMP.ENAME
and EMP.EMPNO = 7876
/ 
--
-- extract() operations
--
set long 10000
select extract(value(X),
                   '/PurchaseOrder/LineItems/LineItem/Description')
from XMLTABLE X
/
select extract(value(X),
                   '/PurchaseOrder/LineItems/LineItem[1]')
from XMLTABLE X
/
set long 10000
set feedback on
select extractValue(value(t),'/Description')
from XMLTABLE X, 
table ( xmlsequence (
        extract(value(X),
                '/PurchaseOrder/LineItems/LineItem/Description')
        )
) t
/
update XMLTABLE t
set value(t) = updateXML(value(t),
           '/PurchaseOrder/Reference/text()',
           'MILLER-200203311200000000PST')
where existsNode(value(t),
                 '/PurchaseOrder[Reference="ADAMS-20011127121040988PST"]') = 1
/
select value(t) 
from XMLTABLE t
/
update XMLTABLE t
set value(t) = 
updateXML(value(t),
          '/PurchaseOrder/LineItems/LineItem[2]',
          xmltype('<LineItem ItemNumber="4">
                      <Description>Andrei Rublev</Description>
                      <Part Id="715515009928" UnitPrice="39.95"
                         Quantity="2"/>
                   </LineItem>'
           )
)
where existsNode(value(t),
                 '/PurchaseOrder[Reference="MILLER-200203311200000000PST"]'
) = 1
/
select value(t)
from XMLTABLE t
where existsNode(value(t),
                 '/PurchaseOrder[Reference="MILLER-200203311200000000PST"]'
) = 1     
/  
select value(t).transform(xmltype(getDocument('purchaseOrder.xsl')))
from XMLTABLE t
where existsNode(value(t),
                 '/PurchaseOrder[Reference="MILLER-200203311200000000PST"]'
) = 1
/      
begin
  dbms_xmlschema.registerSchema( 
                 'http://www.oracle.com/xsd/purchaseOrder.xsd',
                 getDocument('purchaseOrder.xsd'),
                 TRUE, TRUE, FALSE, FALSE
       );
end;
/
create table XML_PURCHASEORDER of XMLType
XMLSCHEMA "http://www.oracle.com/xsd/purchaseOrder.xsd"
ELEMENT "PurchaseOrder"
/
describe XML_PURCHASEORDER
insert into XML_PURCHASEORDER
values (xmltype(getDocument('Invoice.xml')))
/
alter table XML_PURCHASEORDER 
add constraint VALID_PURCHASEORDER 
check (XMLIsValid(sys_nc_rowinfo$)=1)
/
insert into XML_PURCHASEORDER
values (xmltype(getDocument('InvalidPurchaseOrder.xml')))
/
alter table XML_PURCHASEORDER 
drop constraint VALID_PURCHASEORDER
/
create trigger VALIDATE_PURCHASEORDER 
before insert on XML_PURCHASEORDER
for each row
declare
  XMLDATA xmltype;
begin
   XMLDATA := :new.sys_nc_rowinfo$;
   xmltype.schemavalidate(XMLDATA);
end;
/       
insert into XML_PURCHASEORDER
values (xmltype(getDocument('InvalidPurchaseOrder.xml')))
/  
drop table XML_PURCHASEORDER;
begin
  dbms_xmlSchema.deleteSchema('http://www.oracle.com/xsd/purchaseOrder.xsd',4);
end;
/
begin
  dbms_xmlschema.registerSchema( 
                 'http://www.oracle.com/xsd/purchaseOrder.xsd',
                 getDocument('purchaseOrder1.xsd'),
                 TRUE, TRUE, FALSE, FALSE
       );
end;
/
describe XML_PURCHASEORDER_TYPE
drop table XML_PURCHASEORDER;
begin
  dbms_xmlSchema.deleteSchema('http://www.oracle.com/xsd/purchaseOrder.xsd',4);
end;
/
begin
  dbms_xmlschema.registerSchema( 
                 'http://www.oracle.com/xsd/purchaseOrder.xsd',
                 getDocument('purchaseOrder2.xsd'),
                 TRUE, TRUE, FALSE, FALSE
       );
end;
/
describe XML_PURCHASEORDER_TYPE
quit

Loading Files

set echo on
connect &1/&2
declare
  result boolean;
begin
  result := dbms_xdb.createResource('/public/&3/&4',
                                    getFileContent(bfilename('DIR','&4')));
end;
/
commit;
quit

Chapter 3 Examples Script: invoice.xml

<Invoice 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="http://www.oracle.com/xsd/purchaseOrder.xsd">
  <Reference>ADAMS-20011127121040988PST</Reference>
  <Actions>
    <Action>
      <User>SCOTT</User>
      <Date xsi:nil="true"/>
    </Action>
  </Actions>
  <Reject/>
  <Requestor>Julie P. Adams</Requestor>
  <CostCenter>R20</CostCenter>
  <ShippingInstructions>
    <name>Julie P. Adams</name>
    <address>300 Oracle Parkway, Redwood Shores, CA 94065</address>
    <telephone>650 506 7300</telephone>
  </ShippingInstructions>
  <SpecialInstructions>Ground</SpecialInstructions>
  <LineItems>
    <LineItem ItemNumber="1">
      <Description>The Ruling Class</Description>
      <Part Id="715515012423" UnitPrice="39.95" Quantity="2"/>
    </LineItem>
    <LineItem ItemNumber="2">
      <Description>Diabolique</Description>
      <Part Id="037429135020" UnitPrice="29.95" Quantity="3"/>
    </LineItem>
    <LineItem ItemNumber="3">
      <Description>8 1/2</Description>
      <Part Id="037429135624" UnitPrice="39.95" Quantity="4"/>
    </LineItem>
  </LineItems>
</Invoice>

Chapter 3 Examples Script: PurchaseOrder.xml

<PurchaseOrder 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="http://www.oracle.com/xdb/po.xsd">
  <Reference>ADAMS-20011127121040988PST</Reference>
  <Actions>
    <Action>
      <User>SCOTT</User>
      <Date xsi:nil="true"/>
    </Action>
  </Actions>
  <Reject/>
  <Requestor>Julie P. Adams</Requestor>
  <User>ADAMS</User>
  <CostCenter>R20</CostCenter>
  <ShippingInstructions>
    <name>Julie P. Adams</name>
    <address>300 Oracle Parkway, Redwood Shores, CA 94065</address>
    <telephone>650 506 7300</telephone>
  </ShippingInstructions>
  <SpecialInstructions>Ground</SpecialInstructions>
  <LineItems>
    <LineItem ItemNumber="1">
      <Description>The Ruling Class</Description>
      <Part Id="715515012423" UnitPrice="39.95" Quantity="2"/>
    </LineItem>
    <LineItem ItemNumber="2">
      <Description>Diabolique</Description>
      <Part Id="037429135020" UnitPrice="29.95" Quantity="3"/>
    </LineItem>
    <LineItem ItemNumber="3">
      <Description>8 1/2</Description>
      <Part Id="037429135624" UnitPrice="39.95" Quantity="4"/>
    </LineItem>
  </LineItems>
</PurchaseOrder>

<div>

<table> <tr><td> <hr> Note:
<ul> <li>The example XML schema, "XML Schema Example, PurchaseOrder.xsd" is located in Appendix B, "XML Schema Primer".
<li>The example XSL file, "XSL Stylesheet Example, PurchaseOrder.xsl" is located in Appendix D, "XSLT Primer".
</ul> <hr> </td> </tr> </table> </div>

Chapter 3 Examples Script: FTP Script

#! /usr/bin/ksh
TESTDIR=$1
TESTFILENAME=$2
. ./config.sh
SCRIPTFILE=`date '+%Y%m%d%H%M%S'` 
SCRIPTFILE=/tmp/$SCRIPTFILE.cmd
mkdir /tmp/$TESTDIR
echo "open $ORAHOSTNAME $ORAFTPPORT" > $SCRIPTFILE
echo "user $ORASQLUSER $ORASQLPASSWORD" >> $SCRIPTFILE
echo "cd public" >>  $SCRIPTFILE
echo "cd $TESTDIR" >>  $SCRIPTFILE
echo "put $TESTFILENAME" >>  $SCRIPTFILE
echo "ls -l" >> $SCRIPTFILE
echo "get $TESTFILENAME /tmp/$TESTDIR/$TESTFILENAME" >> $SCRIPTFILE
echo "quit" >>  $SCRIPTFILE
ftp -v -n < $SCRIPTFILE
rm $SCRIPTFILE
echo "Diff Results for $TESTFILENAME"
diff -b $TESTFILENAME /tmp/$TESTDIR/$TESTFILENAME
rm -rf /tmp/$TESTDIR

Chapter 3 Examples Script: Configuring FTP and HTTP Ports

#! /usr/bin/ksh
ORAHOSTNAME=`hostname`
ORAFTPPORT=2100
ORAHTTPPORT=8080

if [ "$LOGNAME" = "oracle2" ]
then
  ORAFTPPORT=2122
  ORAHTTPPORT=8088
fi
echo "FTP  Port = $ORAFTPPORT"
echo "HTTP Port = $ORAHTTPPORT"

ORASQLUSER=DOC92
ORASQLPASSWORD=DOC92

RESOURCE_VIEW and PATH_VIEW Database and XML Schema

The following describes the RESOURCE_VIEW and PATH_VIEW structures.

Resource View Definition and Structure

The RESOURCE_VIEW contains one row for each resource in the Repository. The following describes its structure:

Column      Datatype     Description 
------      --------     -------------------------------------------------------
RES         XMLTYPE      A resource in Oracle XML Repository 
ANY_PATH    VARCHAR2     A path that can be used to access the resource in the
                         Repository 
See Also:

Chapter 15, "RESOURCE_VIEW and PATH_VIEW"

PATH_VIW Definition and Structure

The PATH_VIEW contains one row for each unique path in the Repository. The following describes its structure:

Column      Datatype     Description 
------      --------     -----------------------------
PATH        VARCHAR2     Path name of a resource 
RES         XMLTYPE      The resource referred by PATH 
LINK        XMLTYPE      Link property 
See Also:

Chapter 15, "RESOURCE_VIEW and PATH_VIEW"

XDBResource.xsd: XML Schema for Representing Oracle XML DB Resources

Here is the listing for the XML schema, XDBResource.xsd, used to represent Oracle XML DB resources.

XDBResource.xsd

<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xmlns.oracle.com/xdb/XDBResource.xsd"
version="1.0" elementFormDefault="qualified"
xmlns:res="http://xmlns.oracle.com/xdb/XDBResource.xsd">

<simpleType name="OracleUserName">
  <restriction base="string">
    <minLength value="1" fixed="false"/>
    <maxLength value="4000" fixed="false"/>
  </restriction>
</simpleType>

<simpleType name="ResMetaStr">
  <restriction base="string">
    <minLength value="1" fixed="false"/>
    <maxLength value="128" fixed="false"/>
  </restriction>
</simpleType>

<simpleType name="SchElemType">
  <restriction base="string">
    <minLength value="1" fixed="false"/>
    <maxLength value="4000" fixed="false"/>
  </restriction>
</simpleType>

<simpleType name="GUID">
  <restriction base="hexBinary">
    <minLength value="8" fixed="false"/>
    <maxLength value="32" fixed="false"/>
  </restriction>
</simpleType>

<simpleType name="LocksRaw">
  <restriction base="hexBinary">
    <minLength value="0" fixed="false"/>
    <maxLength value="2000" fixed="false"/>
  </restriction>
</simpleType>

<simpleType name="LockScopeType">
  <restriction base="string">
    <enumeration value="Exclusive" fixed="false"/>
    <enumeration value="Shared" fixed="false"/>
  </restriction>
</simpleType>

<complexType name="LockType" mixed="false">
  <sequence>
    <element name="owner" type="string"/>
    <element name="expires" type="dateTime"/>
    <element name="lockToken" type="hexBinary"/>
  </sequence>
  <attribute name="LockScope" type="res:LockScopeType" />
</complexType>

<complexType name="ResContentsType" mixed="false">
  <sequence >
    <any name="ContentsAny" />
  </sequence>
 </complexType>

<complexType name="ResAclType" mixed="false">
  <sequence >
    <any name="ACLAny"/>
  </sequence>
</complexType>

<complexType name="ResourceType" mixed="false">
  <sequence >
    <element name="CreationDate" type="dateTime"/>
    <element name="ModificationDate" type="dateTime"/>
    <element name="Author" type="res:ResMetaStr"/>
    <element name="DisplayName" type="res:ResMetaStr"/>
    <element name="Comment" type="res:ResMetaStr"/>
    <element name="Language" type="res:ResMetaStr"/>
    <element name="CharacterSet" type="res:ResMetaStr"/>
    <element name="ContentType" type="res:ResMetaStr"/>
    <element name="RefCount" type="nonNegativeInteger"/>
    <element name="Lock" type="res:LocksRaw"/>
    <element pname="ACL" type="res:ResAclType" minOccurs="0" maxOccurs="1"/>
    <element name="Owner" type="res:OracleUserName" minOccurs="0" 
maxOccurs="1"/>
    <element name="Creator" type="res:OracleUserName" minOccurs="0" 
maxOccurs="1"/>
    <element name="LastModifier" type="res:OracleUserName" minOccurs="0" 
maxOccurs="1"/>
    <element name="SchemaElement" type="res:SchElemType" minOccurs="0" 
maxOccurs="1"/>
    <element name="Contents" type="res:ResContentsType" minOccurs="0" 
maxOccurs="1"/>
    <element name="VCRUID" type="res:GUID"/>
    <element name="Parents" type="hexBinary" minOccurs="0" maxOccurs="1000"/>      
<any name="ResExtra" namespace="##other" minOccurs="0" maxOccurs="65535"/>
</sequence>

  <attribute name="Hidden" type="boolean"/>
  <attribute name="Invalid" type="boolean"/>
  <attribute name="VersionID" type="integer"/>
  <attribute name="ActivityID" type="integer"/>
  <attribute name="Container" type="boolean"/>
  <attribute name="CustomRslv" type="boolean"/>
  <attribute name="StickyRef" type="boolean"/>

</complexType>
<element name="Resource" type="res:ResourceType"/>
</schema>

acl.xsd: XML Schema for Representing Oracle XML DB ACLs

This section describes the XML schema used to represent Oracle XML DB ACLs:

ACL Representation XML Schema, acl.xsd

Here is XML schema, acl.xsd, used to represent Oracle XML DB ACLs:

acl.xsd

<schema xmlns="http://www.w3.org/2001/XMLSchema"

targetNamespace="http://xmlns.oracle.com/xdb/acl.xsd" version="1.0"
        xmlns:xdb="http://xmlns.oracle.com/xdb"
        xmlns:xdbacl="http://xmlns.oracle.com/xdb/acl.xsd"
        elementFormDefault="qualified">

 <annotation>
     <documentation>
        This XML schema describes the structure of XML DB ACL documents.
        
        Note : The following "systemPrivileges" element lists all supported  
          system privileges and their aggregations.
          See dav.xsd for description of DAV privileges
        Note : The elements and attributes marked "hidden" are for
          internal use only.
     </documentation>
     <appinfo>
       <xdb:systemPrivileges>
        <xdbacl:all>
          <xdbacl:read-properties/>
          <xdbacl:read-contents/>
          <xdbacl:read-acl/>
          <xdbacl:update/>
          <xdbacl:link/>
          <xdbacl:unlink/>
          <xdbacl:unlink-from/>
          <xdbacl:write-acl-ref/>
          <xdbacl:update-acl/>
          <xdbacl:link-to/>
          <xdbacl:resolve/>
        </xdbacl:all>
       </xdb:systemPrivileges>
     </appinfo>
   </annotation>

  <!-- privilegeNameType (this is an emptycontent type) -->
  <complexType name = "privilegeNameType"/>

  <!-- privilegeName element 
       All system and user privileges are in the substitutionGroup 
       of this element. 
    -->
  <element name = "privilegeName" type="xdbacl:privilegeNameType"
           xdb:defaultTable=""/>

  <!-- all system privileges in the XML DB ACL namespace -->
  <element name = "read-properties" type="xdbacl:privilegeNameType"
           substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
  <element name = "read-contents" type="xdbacl:privilegeNameType"
           substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
  <element name = "read-acl" type="xdbacl:privilegeNameType"
           substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
  <element name = "update" type="xdbacl:privilegeNameType"
           substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
  <element name = "link" type="xdbacl:privilegeNameType"
           substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
  <element name = "unlink" type="xdbacl:privilegeNameType"
           substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
  <element name = "unlink-from" type="xdbacl:privilegeNameType"
           substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
  <element name = "write-acl-ref" type="xdbacl:privilegeNameType"
           substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
  <element name = "update-acl" type="xdbacl:privilegeNameType"
           substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
  <element name = "link-to" type="xdbacl:privilegeNameType"
           substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
  <element name = "resolve" type="xdbacl:privilegeNameType"
           substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
  <element name = "all" type="xdbacl:privilegeNameType"
           substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>

<!-- privilege element -->
  <element name = "privilege" xdb:SQLType = "XDB$PRIV_T" xdb:defaultTable="">
    <complexType> 
      <choice maxOccurs="unbounded">
        <any xdb:transient="generated"/>
        <!-- HIDDEN ELEMENTS -->
        <element name = "privNum" type = "hexBinary" xdb:baseProp="true" 
                 xdb:hidden="true"/>
      </choice> 
    </complexType>
  </element>

<!-- ace element -->
  <element name = "ace" xdb:SQLType = "XDB$ACE_T" xdb:defaultTable="">
     <complexType> <sequence>
       <element name = "grant" type = "boolean"/>
       <element name = "principal" type = "string"
                xdb:transient="generated"/>
       <element ref="xdbacl:privilege" minOccurs="1"/>
       <!-- HIDDEN ELEMENTS -->
       <element name = "principalID" type = "hexBinary" minOccurs="0"
                xdb:baseProp="true" xdb:hidden="true"/>
       <element name = "flags" type = "unsignedInt" minOccurs="0" 
                xdb:baseProp="true" xdb:hidden="true"/>
     </sequence> </complexType>
  </element>

  <!-- acl element -->
  <element name = "acl" xdb:SQLType = "XDB$ACL_T" xdb:defaultTable = "XDB$ACL">
    <complexType> 
     <sequence>
      <element name = "schemaURL" type = "string" minOccurs="0"
               xdb:transient="generated"/>
      <element name = "elementName" type = "string" minOccurs="0" 
               xdb:transient="generated"/>
      <element ref = "xdbacl:ace" minOccurs="1" maxOccurs = "unbounded"
               xdb:SQLCollType="XDB$ACE_LIST_T"/>
        
      <!-- HIDDEN ELEMENTS -->
      <element name = "schemaOID" type = "hexBinary" minOccurs="0"
               xdb:baseProp="true" xdb:hidden="true"/>
      <element name = "elementNum" type = "unsignedInt" minOccurs="0"
               xdb:baseProp="true" xdb:hidden="true"/>
     </sequence>
     <attribute name = "shared" type = "boolean" default="true"/>
     <attribute name = "description" type = "string"/>
    </complexType>
  </element>

 </schema>';

xdbconfig.xsd: XML Schema for Configuring Oracle XML DB

Here is xdbconfig.xsd, the XML schema used to configure Oracle XML DB:

xdbconfig.xsd

<schema targetNamespace="http://xmlns.oracle.com/xdb/xdbconfig.xsd"
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:xdbc="http://xmlns.oracle.com/xdb/xdbconfig.xsd"
        xmlns:xdb="http://xmlns.oracle.com/xdb"
        version="1.0" elementFormDefault="qualified">

  <element name="xdbconfig" xdb:defaultTable="XDB$CONFIG">

  <complexType><sequence>

    <!-- predefined XML DB properties - these should NOT be changed -->
    <element name="sysconfig">
    <complexType><sequence>     
        <!-- generic XML DB properties -->
        <element name="acl-max-age" type="unsignedInt" default="1000"/>
        <element name="acl-cache-size" type="unsignedInt" default="32"/>
        <element name="invalid-pathname-chars" type="string" default=""/>
        <element name="case-sensitive" type="boolean" default="true"/>
        <element name="call-timeout"   type="unsignedInt" default="300"/>
        <element name="max-link-queue" type="unsignedInt" default="65536"/>
        <element name="max-session-use" type="unsignedInt" default="100"/>
        <element name="persistent-sessions" type="boolean" default="false"/>
        <element name="default-lock-timeout" type="unsignedInt" 
                                                   default="3600"/>
        <element name="xdbcore-logfile-path" type="string" 
                                     default="/sys/log/xdblog.xml"/> 
        <element name="xdbcore-log-level" type="unsignedInt" default="0"/>
        <element name="resource-view-cache-size" type="unsignedInt"
                                                 default="1048576"/>
        <element name="case-sensitive-index-clause" type="string" 
minOccurs="0"/>
        
        <!-- protocol specific properties -->
        <element name="protocolconfig">
        <complexType><sequence>

            <!-- these apply to all protocols -->
            <element name="common">
            <complexType><sequence>
                <element name="extension-mappings">
                <complexType><sequence> 
                  <element name="mime-mappings" type="xdbc:mime-mapping-type"/>
                  <element name="lang-mappings" type="xdbc:lang-mapping-type"/>
                  <element name="charset-mappings" 
                                             type="xdbc:charset-mapping-type"/>
                  <element name="encoding-mappings" 
                                            type="xdbc:encoding-mapping-type"/>
                </sequence></complexType>
                </element>
                <element name="session-pool-size" type="unsignedInt" 
                                                          default="50"/>
                <element name="session-timeout"   type="unsignedInt" 
                                                          default="6000"/>

            </sequence></complexType>
            </element>    

            <!-- FTP specific -->
            <element name="ftpconfig">
            <complexType><sequence>
              <element name="ftp-port" type="unsignedShort" default="2100"/>
              <element name="ftp-listener" type="string"/>
              <element name="ftp-protocol" type="string"/>
              <element name="logfile-path" type="string" 
                                               default="/sys/log/ftplog.xml"/> 
              <element name="log-level" type="unsignedInt" default="0"/>
              <element name="session-timeout"  type="unsignedInt" 
                                                         default="6000"/>
              <element name="buffer-size" default="8192">
                <simpleType>
                  <restriction base="unsignedInt">
                    <minInclusive value="1024"/>       <!-- 1KB -->
                    <maxInclusive value="1048496"/>    <!-- 1MB -->  
                  </restriction>
                </simpleType>
              </element>
            </sequence></complexType>
            </element>  

            <!-- HTTP specific -->
            <element name="httpconfig">
            <complexType><sequence>
                <element name="http-port" type="unsignedShort" default="8080"/>
                <element name="http-listener" type="string"/>
                <element name="http-protocol" type="string"/>
                <element name="max-http-headers" type="unsignedInt" 
                                                               default="64"/>
                <element name="max-header-size" type="unsignedInt" 
                                                               default="4096"/>
                <element name="max-request-body" type="unsignedInt" 
                                          default="2000000000" minOccurs="1"/>
                <element name="session-timeout"  type="unsignedInt" 
                                                            default="6000"/>
                <element name="server-name" type="string"/>              
                <element name="logfile-path" type="string" 
                                            default="/sys/log/httplog.xml"/> 
                <element name="log-level" type="unsignedInt" default="0"/>
                <element name="servlet-realm" type="string" minOccurs="0"/>

                <element name="webappconfig">
                <complexType><sequence> 
                  <element name="welcome-file-list" 
                                               type="xdbc:welcome-file-type"/>
                  <element name="error-pages" type="xdbc:error-page-type"/>
                  <element name="servletconfig" 
                                             type="xdbc:servlet-config-type"/> 
                </sequence></complexType>
                </element>
                <element name="default-url-charset" type="string" 
                                                               minOccurs="0"/>
            </sequence></complexType>
            </element>

        </sequence></complexType>
        </element>

    </sequence></complexType>
    </element>
 

   <!-- users can add any properties they want here -->        
   <element name="userconfig" minOccurs="0">
        <complexType><sequence>
           <any maxOccurs="unbounded" namespace="##other"/>
        </sequence></complexType>
   </element>

  </sequence></complexType>

  </element>

  <complexType name="welcome-file-type">
     <sequence>                        
         <element name="welcome-file" minOccurs="0" maxOccurs="unbounded">
          <simpleType>
          <restriction base="string">
            <pattern value="[^/]*"/>
          </restriction>
          </simpleType>
         </element>
     </sequence>
  </complexType>

  <!-- customized error pages -->
  <complexType name="error-page-type">
  <sequence>    
        <element name="error-page" minOccurs="0" maxOccurs="unbounded">
        <complexType><sequence>
              <choice>
                <element name="error-code">
                  <simpleType>
                    <restriction base="positiveInteger">
                      <minInclusive value="100"/>
                      <maxInclusive value="999"/>
                    </restriction>
                  </simpleType>
                </element>
                
                <!-- Fully qualified classname of a Java exception type -->
                <element name="exception-type" type="string"/>
        
                <element name="OracleError">
                 <complexType><sequence>
                    <element name="facility" type="string" default="ORA"/>
                    <element name="errnum" type="unsignedInt"/>
                 </sequence></complexType>
                </element>
              </choice>
        
              <element name="location" type="anyURI"/>

         </sequence></complexType>
         </element>
  </sequence>   
  </complexType>


  <!-- parameter for a servlet: name, value pair and a description  -->
  <complexType name="param">
    <sequence>
      <element name="param-name" type="string"/>        
      <element name="param-value" type="string"/>
      <element name="description" type="string"/>    
    </sequence>
  </complexType>

  <complexType name="servlet-config-type">
    <sequence>
         <element name="servlet-mappings">
           <complexType><sequence>
              <element name="servlet-mapping" minOccurs="0" 
                       maxOccurs="unbounded">
              <complexType><sequence>
                  <element name="servlet-pattern" type="string"/>
                  <element name="servlet-name" type="string"/>
              </sequence></complexType>
              </element>
           </sequence></complexType>
          </element> 

      <element name="servlet-list"> 
        <complexType><sequence>
              <element name="servlet" minOccurs="0" maxOccurs="unbounded">
                <complexType><sequence>
                  <element name="servlet-name" type="string"/>
                  <element name="servlet-language">
                    <simpleType>
                      <restriction base="string">
                        <enumeration value="C"/>
                        <enumeration value="Java"/>
                        <enumeration value="PL/SQL"/>
                      </restriction>
                    </simpleType> 
                  </element> 
                  <element name="icon" type="string" minOccurs="0"/>
                  <element name="display-name" type="string"/>
                  <element name="description" type="string" minOccurs="0"/>
                  <choice>
                    <element name="servlet-class" type="string" minOccurs="0"/>
                    <element name="jsp-file" type="string" minOccurs="0"/>
                  </choice>
                  <element name="servlet-schema" type="string" minOccurs="0"/>
                  <element name="init-param" minOccurs="0" 
                           maxOccurs="unbounded" type="xdbc:param"/>
                  <element name="load-on-startup" type="string" minOccurs="0"/>
                  <element name="security-role-ref" minOccurs="0" 
                        maxOccurs="unbounded">
                  <complexType><sequence>
                      <element name="description" type="string" minOccurs="0"/>
                      <element name="role-name" type="string"/>
                      <element name="role-link" type="string"/>
                  </sequence></complexType>
                  </element>
                </sequence></complexType>
              </element>
        </sequence></complexType>
      </element> 
  </sequence>
  </complexType>    


  <complexType name="lang-mapping-type"><sequence>
      <element name="lang-mapping" minOccurs="0" maxOccurs="unbounded">
        <complexType><sequence>
        <element name="extension" type="xdbc:exttype"/>
        <element name="lang" type="string"/>
        </sequence></complexType>
      </element></sequence>
  </complexType>


  <complexType name="charset-mapping-type"><sequence>
      <element name="charset-mapping" minOccurs="0" maxOccurs="unbounded">
        <complexType><sequence>
        <element name="extension" type="xdbc:exttype"/>
        <element name="charset" type="string"/>
        </sequence></complexType>
      </element></sequence>
  </complexType>

  <complexType name="encoding-mapping-type"><sequence>
      <element name="encoding-mapping" minOccurs="0" maxOccurs="unbounded">
        <complexType><sequence>
        <element name="extension" type="xdbc:exttype"/>
        <element name="encoding" type="string"/>
        </sequence></complexType>
      </element></sequence>
  </complexType>

 <complexType name="mime-mapping-type"><sequence>
      <element name="mime-mapping" minOccurs="0" maxOccurs="unbounded">
      <complexType><sequence>
        <element name="extension" type="xdbc:exttype"/>
        <element name="mime-type" type="string"/>
      </sequence></complexType>
      </element></sequence> 
  </complexType> 

  <simpleType name="exttype">
      <restriction base="string">
        <pattern value="[^\*\./]*"/>
      </restriction>
  </simpleType>

</schema>