Skip Headers
< tr>
Oracle® XML DB Developer's Gu ide
10
g
Release 1 (10.1)
Part Number B10790-01
Home
Book List
Index
Master Index< /font>
Feedback
Next
View PDF
< div class="IND">
Contents
List of Examples
Li st of Figures
List of Tables
Title and Copyright Information
Send Us Your Comments
Preface
Intended Audience
Documentation Accessibility
Structure
Related Documents
Conventions
What's New In Oracle XML DB?
Oracle XML DB: Oracle Database 10g Release 1 (10.1), Enhancements
Oracle Text Enhancements
Oracle Streams Advanced Queuing (AQ) Support
Oracle XDK Support for XMLType
Part I Introducing Oracle XML DB
1
Introducing Oracle XML DB
Introducing O racle XML DB
Oracle XML DB Architecture
XMLType Storage
Oracle XML DB Repository
APIs for Accessing and Manipulating XML
XML Services
dd>
XML Repository Architecture
How Does Oracle XML& nbsp;DB Repository Work?
Oracle XML DB Protocol Architecture
Programmatic Access to Oracle XML DB (Java, PL/SQL, and C)
Oracle XML DB Features
XMLType
XML Schema
Structured Versus Unstructured Storage
XML / SQL Duality
SQL/XML ICITS Standard Operators
XPath and XQuery Rewrite
Oracle XML DB Benefits
Unifying Data and Content with Oracle XML DB
Exploiting Database Capabilities
Exploiting XML C apabilities
Oracle XML DB Offers Faster Storage and Retrieval of Complex XML Documents
Oracle XML DB Helps You Integrate Applications
When Your Data Is Not XML You Can Use XMLType Views
Sea rching XML Data Stored in CLOBs Using Oracle Text
Building Messaging Applications using Oracle Streams Advanced Queuing
Managing Oracle XML DB Applications with Oracle Ent erprise Manager
Requirements for Running Oracle XML DB
Standards Supported by Oracle XML DB
Oracle XML DB Technical Support
Oracle XML DB Examples Used in This Manual
Further Oracle XML DB Case Studies and Demonstrations
2
Getting Started with Oracle XML DB
Installing Oracle XML DB
When to Use Oracle XML DB
Designing Your XML Application
Oracle XML&nbs p;DB Design Issues: Introduction
a. Data
b. Access
c. Application Language
d . Processing
e. Storage
Oracle XM L DB Application Design: a. How Structured Is Your Data?
XML Schema-Based or Non-Schema-Based
Oracle XML DB Application Design: b. Access Models a>
Oracle XML DB Application Design: c. Application Language
Oracle XML DB Application Design: d. Processing Models
Messaging Options
Oracle XML DB Design: e. Storage Models
Using XMLType Tables
Using XMLType Views
Oracle XML DB Performance
XML Storage Requirements
XML Memory Management
XML Parsing Optimizations
Node-Searching Optimizations
XML Schema Optimizations
Load Balancing Through Cached XML S chema
Reduced Non-Native Code Bottlenecks
Reduced Java Type Conversion Bottlenecks
3
Using Oracle XML DB
Storing XML as XMLType
What is XMLType
Benefits of the XMLType Datatype and API
When to Use XMLType
There are Two Main Ways to Store XMLType Data: LOBs and Structured
Advantages and Disadvantages of XML Storage Options in Oracle XML DB
When to Use C LOB Storage for XMLType
Creating XMLType Tables and Columns
Loading XML Content Into Oracle XML DB
Load ing XML Content into Oracle XML DB Using SQL or PL/SQL
Loading XML Content into Or acle XML DB Using Java
Loading XML Content into Oracle XML DB Using C
Loading Very Large XML Files of Smaller XML Documents into Oracle Database
Loading Large XML Files into Oracle Database Using SQL*Loader
Loading XML Documents into Oracle XML DB Repository
Loading Documents into Oracl e XML DB Repository Using Protocols
Handling Non-ASCII XML Documents
XML Encoding Declaration
Loading Non-ASCII X ML Documents
Retrieving Non-ASCII XML Documents
APIs Introduced in 10
g
Release 1 for Handling Non-ASCII Documents
Introducing the W3C XML Schema Recommendation
XML Instance Doc uments
The Schema for Schemas
Editing XML Schemas
XML Schema Features
Te xt Representation of the PurchaseOrder XML Schema
Graphical Representation of the Purch aseOrder XML Schema
XML Schema and Oracle XML DB
Why Use XML Schema With Oracle XML DB?
Validating Instance Documents with XML Schema
Constraining Instance Documents for Business Rules or Format Compliance
Defining How XMLType Contents Must be Stored i n the Database
Structured Storage of XML Documents
Annotating an XML Schema to Control Naming, Mapping, and Storage
Co ntrolling How XML Collections are Stored in the Database
Collections: Default Mapping
Declaring the Oracle XML DB Namespace
Registering an XML Schema with Oracle XML DB
SQL Ty pes and Tables Created During XML Schema Registration
Working with Large XML Schemas
Working with Global Elements
Crea ting XML Schema-Based XMLType Columns and Tables
Default Tables
Identifying Instance Documents
noNamespaceSc hemaLocation Attribute
schemaLocation Attribute
Dealing with Multiple Namespaces
Using the Database to Enforce XML Dat a Integrity
Comparing Partial to Full XML Schema Validation
Partial Validation
Full Validation
Using SQL Constraints to Enforce Referential Integrity
DML Operations on XML Content Using Oracle XML DB
X Path and Oracle XML
Querying XML Content Stored in Oracle XML DB
A PurchaseOrder XML Document
Retrievin g the Content of an XML Document Using Object_Value
Accessing Fragments or Nodes of an XML Document Using extract()
Accessing Text Nodes and Attribute Values Using extractVal ue()
Invalid Use of extractValue()
Searching the Content of an XML Document Using existsNode()
Using extract Value() and existsNode() in the WHERE Clause
Using XMLSequence() to Perform SQL Operati ons on XMLType Fragments
Accessing and Updating XML Content in Oracle XML DB Repos itory
Relational Access to XML Content Stored in Oracle XML DB Using Vie ws
Updating XML Content Stored in Oracle XML DB
Updating XML Schema-Based and Non-Schema-Based XML Documents
Namespace Support in Oracle XML DB
Processing XMLType Methods and XML-Specif ic SQL Functions
Understanding and Optimizing XPath Rewrite
Using the EXPLAIN Plan to Tune XPath Rewrites
Us ing Indexes to Tune Simple XPath-Based Operations
Using Indexes to Improve Pe rformance of XPath-Based Functions
Optimizing Operations on Collections
Using Indexes to Tune Queries on Collections Stored as Nested Tables
EXPLAIN Plan Output with ACL-Based Security Enabled: SYS_CHECKACL() Filter
Accessing Relational Database Content Using XML
Generating XML From Relational Tables Using DBUriType
XSL Transformation
Using XSLT with Oracle XML DB
Using Oracle XML DB Repository
Installing and Uninstalling O racle XML DB Repository
Oracle XML DB Provides Name-Level Not Folder-Level Lo cking
Use Protocols or SQL to Access and Process Repository Content
Using Standard Protocols to Store and Retrieve Content
Uploa ding Content Into Oracle XML DB Using FTP
Accessing Oracle XML DB Repository Programmatically
Accessing the Content of Documents Using SQL
Accessing the Content of XML Schema-Based Documents
Usin g the XMLRef Element in Joins to Access Resource Content in the Repository
Up dating the Content of Documents Stored in Oracle XML DB Repository
Updat ing Repository Content Using Protocols
Updating Repository Content Using SQL
< dd>
Updating XML Schema-Based Documents in the Repository
Controlling Access to Repository Data
XML DB Transactional Semantics
dd>
Querying Metadata and the Folder Hierarchy
Querying Resources Stored in RESOURCE_VIEW and PATH_VIEW
The Oracle XM L DB Hierarchical Index
How Documents are Stored in Oracle XML DB Repository< /a>
Viewing Relational Data as XML From a Browser
Using DBUri Servlet to Access Any Table or View From a Browser
XSL Transformation Using DBUri Servlet
Part II Storing and Retrieving XML Data in Oracle XML DB
4
XMLType Operations
Manipulating XML Data With SQL Member Functions
Selecting and Querying XML Data< /a>
Searching XML Documents With XPath Expressions
Oracle Extension XPath Function Support
Selecting X ML Data Using XMLType Member Functions
Querying XML Data Using XMLType Functions
existsNode() XMLType Function
Using I ndexes to Evaluate existsNode()
extract() XMLType Function
extractValue() XMLType Function
A Shortcut Functi on
extractValue() Characteristics
Querying XML Data With SQL
Updating XML Instances and XML Data in Tables a>
updateXML() XMLType Function
upd ateXML() and NULL Values
Updating the Same XML Node More Than Once
Guidelines For Preserving DOM Fidelity When Using updateXML()
When DOM Fidelity is Preserved
When DOM Fidelity is Not Preserved
dl>
Optimization of updateXML()
Creating View s of XML Data with updateXML()
Indexing XMLType Columns
XPATH REWRITE for indexes on Singleton Elements or Attributes
Creating B-Tree Indexes on the Contents of a Collection
Creating Function-Bas ed Indexes on XMLType Tables and Columns
CTXXPath Indexes on XMLType Columns
< dd>
CTXXPATH Indexing Features
Creating CTXXP ATH Indexes
Creating CTXXPATH Storage Preferences With CTX_DDL. Statements
Performance Tuning a CTXXPATH Index: Synchronizing and Optimizing
Choosing the Right Plan: Using CTXXPATH Index in existsNode() Processing
C TXXPATH Indexes On XML Schema-Based XMLType Tables
Determining If an Index is Being Use d: Tracing
CTXXPATH Indexing Depends on Storage Options and Document Size
Oracle Text Indexes on XMLType Columns
5
XML Schema Storage and Query: The Basics
Introducing XML Schema
XML Schema and O racle XML DB
Using Oracle XML DB and XML Schema
Why We Need XML Schema
XML Schema Provides Flexibl e XML-to-SQL Mapping Setup
XML Schema Allows XML Instance Validation
DTD Support in Oracle XML DB
Inlin e DTD Definitions
External DTD Definitions
Managing XML Schemas Using DBMS_XMLSCHEMA
Registering Y our XML Schema
Storage and Access Infrastructure
Transactional Action of XML Schema Registration
Managing and Storing XML Schema
Debugging XML Schema Registration
SQL Ob ject Types
Creating Default Tables During XML Schema Registration
Generated Names are Case Sensitive
Objects That Depend on Regi stered XML Schemas
How to Obtain a List of Registered XML Schemas
Deleting Your XML Schema Using DBMS_XMLSCHEMA
FORCE Mode
XML Schema-Related Methods of XMLType
Local and Global XML Schemas
Local XML Schema
Global XML Schema
DOM Fidelity
How Oracle XML DB Ensures DOM Fidelity with XML Schema
DOM Fidelity and SYS_XDBPD$
Creating XMLType Tables and C olumns Based on XML Schema
Specifying Unstructured (LOB-Based) Storage of Sch ema-Based XMLType
Specifying Storage Models for Structured Storage of Schema-Based XMLT ype
Specifying Relational Constraints on XMLType Tables and Columns
Oracle XML Schema Annotations
Querying a Registere d XML Schema to Obtain Annotations
SQL Mapping Is Specified in the XML Schema During Registration
Mapping of Types Using DBMS_XMLSCHEMA
Setting Attribute Mapping Type Information
Overriding the SQLType Value in XML Schema When Declaring Attributes
Sett ing Element Mapping Type Information
Overriding the SQLType Value in XML Sche ma When Declaring Elements
Mapping simpleTypes to SQL
simpleType: Mapping XML Strings to SQL VARCHAR2 Versus CLOBs
Working with Time Zones
Mapping complexTypes to SQL
Specifying Attributes in a complexType XML Schema Declaration
XPath Rewrite with XML Schema-Based Structured Storage
What Is XPath Rewrite?
When Does XPath Rewrite Occur?
What XPath Expressions Are Rewritten?
Common XPath Co nstructs Supported in XPath Rewrite
Unsupported XPath Constructs in XPath Rewrite
dd>
Common XMLSchema constructs supported in XPath Rewrite
Unsupported XML Schema Constructs in XPath Rewrite
Common storage constructs s upported in XPath Rewrite
Unsupported Storage Constructs in XPath Rewrite
Is there a difference in XPath logic with rewrite?
How are the XPaths Rewritten?
Rewriting XPath Expressions: Mapping Typ es and Path Expressions
Rewrite of SQL Functions
Diagnosing XPath Rewrite
Using Explain Plans
< a href="xdb05sto.htm#sthref687">Using Events
6
XML Schema Storage and Query: Advanced Topics
Generating XML Schema Using DBMS_XMLSCHEMA.generateSchema()
A dding Unique Constraints to An Attribute's Elements
Setting the SQLInLine Attribute to FALSE for Out-of-Line Storage
Query Rewrite For Out-Of-Line Tables
dl>
Storing Collections in Out-Of-Line Tables
Intermediate table for storing the list of references
Fully Qualif ied XML Schema URLs
Fully Qualified XML Schema URLs Permit Explicit Reference to XML Schema URLs
Mapping XML Fragments to Large Objects (LOBs)
Oracle XML DB complexType Extensions and Restrictions
complexType Declarations in XML Schema: Handling Inheritance
Mapping c omplexType: simpleContent to Object Types
Mapping complexType: Any and AnyAttributes
Inserting New Instances into XMLType Columns
Examining Type Information in Oracle XML DB
ora:instanceof() and ora:instanceof-only()
Working With Circular and Cyclical Dependencies
For Circular Dependency Set GenTables Parameter to TRUE
Handling Cycling Between complexTypes in XML Schema
Ho w a complexType Can Reference Itself
Oracle XML DB: XPath Expr ession Rewrites for existsNode()
existsNode Mapping with Document Order Maint ained
existsNode Mapping Without Maintaining Document Order
Oracle XML DB: Rewrite for extractValue()
Oracle XML& nbsp;DB: Rewrite for extract()
Extract Mapping with Document Order Maintained
Extract Mapping Without Maintaining Document Order
Optimizing Updates Using updateXML()
Cyclical References Between X ML Schemas
Guidelines for Using XML Schema and Oracle XML DB
Using Bind Variables in XPath Expressions
Creating Constraints on Repetitive Elements in Schema-Based XML Instance Documents
Guid elines for Loading and Retrieving Large Documents with Collections
Guidelines for Setting xdbcore Parameters
Updating Your XML Schema Using Schema Evoluti on
7
XML Sch ema Evolution
Introducing XML Schema Evolution
Limitations of CopyEvolve()
Example XML Schema
Guidelines for Using DBMS_XMLSCHEMA.CopyEvolve()
Top-Level Element Name Changes
Ensure that the XML Schema and Dependent s are Not Used by Concurrent Sessions
What Happens When CopyEvolve() Raises an Error? R ollback
Failed Rollback From Insufficient Privileges
Using CopyEvolve(): Privileges Needed
DBMS_XMLSCHEMA.CopyEvolve() Syntax
How DBMS_XMLSCHEMA.CopyEvolve() Works
8
Transforming and Validating XMLType Data
Transforming XMLType Instances
XMLTransform() and XMLType.transform()
XMLTransform() Examples
Validating XMLType Instances
XMLIsValid() a>
schemaValidate
isSchemaValidated()
setSchemaValidated()
isSchemaValid()
Validating XML Data Stored as XMLType: Examples
9
Full Text Search Over XML
Full Text Search and XML
Comparison of Full Text Search and Other Search Types
XML search
Search using Full Text and XML Structure
About the Examples in this Cha pter
Roles and Privileges
Examp les Schema and Data
Overview of CONTAINS and ora:contains
Overview of the CONTAINS SQL Function
Overview of the ora:contains XPath Function
Comparison of CONTAINS and ora:contains
dd>
CONTAINS SQL Function
Full Text Sear ch
Boolean Operators: AND, OR, NOT
Stemming: $
Combining Boolean and Stemming Operators
Score
Structure: Restricting the Scope of the Search
WITHIN
INPATH
HASPATH
Structure: Projecting the Result
Indexing
Introduction to the CONTEXT Index
Effect of the CONTEXT Index on CONTAINS
The CONTEXT Index: Preferences
Introduction to Section Groups
ora:contains XPath Function
Full Text Se arch
Score
Structure: Restricting the Sco pe of the Query
Structure: Projecting the Result
Policies
Introduction to Policies
Effect of Policies on ora:contains
Policy Defaults
ora:contains Performance
Use a Primary Filter in the Query
Use a CTXXPath Index
Query- Rewrite and the CONTEXT Index
Text Path BNF
Example Support
Purchase Order po001.xml
< dd>
Create Table Statements
An XML Schema for the Sam ple Data
Part III Using APIs f or XMLType to Access and Operate on XML
10
PL/SQL API for XMLType
Introducing PL/SQ L APIs for XMLType
PL/SQL APIs For XMLType Features
< a href="xdb10pls.htm#sthref1020">Lazy XML Loading (Lazy Manifestation)
XMLType Datatyp e Now Supports XML Schema
XMLType Supports Data in Different Character Sets.
< /dl>
With PL/SQL APIs for XMLType You Can Modify and Store XML Elements
PL/SQL DOM API for XMLType (DBMS_XMLDOM)
Introducing W3C Document Object Model (DOM) Recommendation
W3C DOM Exten sions Not Supported in This Release
Supported W3C DOM Recommendations
Difference Between DOM and SAX
PL/SQL DOM API for XMLType (DBMS_XMLDOM): Features
Enhanced Performance
Designing End-to-End Applications Using XDK and Oracle XML DB
Using PL/SQL DOM API for XMLType: Preparing XML Data
Generating an XML Schema Mapping to SQL Object Types
DOM Fidelity for XML Schema Mapping< /a>
Wrapping Existing Data into XML with XMLType Views
PL/SQL DOM API for XMLType (DBMS_XMLDOM) Methods
Non-S upported DBMS_XMLDOM Methods in This Release
PL/SQL DOM API for XMLType (DBM S_XMLDOM) Exceptions
PL/SQL DOM API for XMLType: Node Types
Working with Schema-Based XML Instances
DOM NodeList and NamesNod eMap Objects
PL/SQL DOM API for XMLType (DBMS_XMLDOM): Calling Sequence
< a href="xdb10pls.htm#sthref1068">PL/SQL DOM API for XMLType Examples
PL/SQL Parser API for XMLType (DBMS_XMLPARSER)
PL/SQL Parser API for XMLType: Featu res
PL/SQL Parser API for XMLType (DBMS_XMLPARSER): Calling Sequence
PL/SQL Parser API for XMLType Example
PL/SQL X SLT Processor for XMLType (DBMS_XSLPROCESSOR)
Enabling Transformations and C onversions with XSLT
PL/SQL XSLT Processor for XMLType: Features
PL/SQL XSLT Processor API (DBMS_XSLPROCESSOR): Methods
PL/SQ L Parser API for XMLType (DBMS_XSLPROCESSOR): Calling Sequence
PL/SQL XSLT Processor f or XMLType Example
11
DBMS_XMLSTORE
Overview of DBMS_XMLSTORE
dd>
Using DBMS_XMLSTORE
Insert Processin g with DBMS_XMLSTORE
Update Processing with DBMS_XMLSTORE
Delete Processing with DBMS_XMLSTORE
12
Java API for XMLType
Introducing Java DOM API for XMLType
Java DOM API for XMLType
Accessing XML Documents in Repository
Accessing XM L Documents Stored in Oracle Database (Java)
Using JDBC to Access XMLType Data
How Java Applications Use JDBC to Access XML Documents in Oracle XML DB
Using JDBC to Manipulate XML Documents Stored in a Database
Loading a Large XML Document into the Database With JDBC
Java DOM API for XMLType Features
Creating XML Documents Programmatica lly
Creating XML Schema-Based Documents
JDBC or SQLJ
Java DOM API for XMLType Classes
Java Methods Not Supported
Java DOM AP I for XMLType: Calling Sequence
13
Using C API for XML With Oracle XML DB
Introducing the C API for XML (XDK and Oracle XML DB)
Using OCI and the C API for XML with Oracle XML DB
XML Context
OCIXmlDbFreeXmlCtx() Syntax
OCIXmlDbInitXmlCtx() Syntax
< /dd>
How to Use Oracle XML DB Functions
OCI Usage
Accessing XMLType Data From the Back End
Creating XMLType Instances on the Client
Common XMLType O perations in C
1 4
Using ODP.NET With Oracle XML DB
Overview of Oracle Data P rovider for .NET (ODP.NET)
ODP.NET XML Support
ODP.NET Sample Code
Part IV Viewing Existing Data as XML
15
Generating XML Data from the Database
Oracle XML DB Options for Generating XML Data From Oracle Database
Generating XML Using SQL/XML Functions
Generating XML Using Oracle Database Extensi ons to SQL/XML
Generating XML Using DBMS_XMLGEN
Generating XML Using SQL Functions
Generating XML with XSQL Pages Publishing Framework
Generating XML Using XML SQL Utility (XSU)
Generating XML from the Database Using SQL/XML Functions
XMLEl ement() Function
XML_Attributes_Clause
XMLForest() Function
XMLSequence() Function
XMLConcat() Function
XMLAgg() Function
XMLColAttVal() Function
Generating XML from Oracle Database U sing DBMS_XMLGEN
Sample DBMS_XMLGEN Query Result
DBMS_XMLGEN Calling Sequence
Generating XML Using Oracle Database-Provided SQL Functions
SYS_XMLGEN() Function
Using XMLFormat Object Type
SYS_XMLAGG() Function< /a>
Generating XML Using XSQL Pages Publishing Framework
Generating XML Using XML SQL Utility (XSU)
Guidelines for Generating XML With Oracle XML DB
Using XMLAgg ORDER BY Clause to Order Query Results Before Aggregation
Using XMLSequence in the TABLE Clause to Return a Rowset
< /dl>
16
XMLType Views
What Are XMLType Views?
Creating XMLType Views: Syntax
Creating Non-Schema-Based XMLTy pe Views
Using SQL/XML Generation Functions
Using Object Types with SYS_XMLGEN()
Creating XML Schema-Base d XMLType Views
Using SQL/XML Generation Functions
Step 1. Register XML Schema, emp_simple.xsd
Step 2. Cr eate XMLType View Using SQL/XML Functions
Using Namespaces With SQL/XML Functions
< /dd>
Using Object Types and Views
Step 1. Create Object Types
Step 2. Create or Generate XMLSchema, emp.xsd
Step 3. Register XML Schema, emp_complex.xsd
Step 4a. Using the One-Step Process
Step 4b. Using the Two-Step Process by First Creat ing an Object View
Step 1. Create Object Types
Step 2. Register XML Schema, dept_complex.xsd
Step 3a. Create XMLType Views on Relational Tables
Step 3b. Create XMLType Views Using SQL/XML Functions
Creating XMLType Views From XMLType Tables
Referencing XMLType View Objects Using REF()
DML (Data Manipulation Languag e) on XMLType Views
XPath Rewrite on XMLType Views
XPath Rewrite on XMLType Views Constructed With SQL/XML Generation Functions
XPath Rewrite on Non-Schema-Based Views Constructed With SQL/XML
XPath Rewrite on View Constructed With SQL/XML Generation Functions
XPath Rewrite on Views Using Object Types, Object Views, and SYS_XMLGEN()
XPath Re write on Non-Schema-Based Views Using Object Types or Views
XPath Rewrite on XML-Schem a-Based Views Using Object Types or Object Views
XPath Rewrite Eve nt Trace
Generating XML Schema-Based XML Without Creating Views
17
Creating and Accessing Data Th rough URLs
How Oracle Database Works with URLs and URIs
Accessing and Processing Data Through HTTP
Crea ting Columns and Storing Data Using UriType
UriFactory Package
Other Sources of Information About URIs and URLs
URI Concepts
What Is a URI?
How to Create a URL Path From an XML Document View
UriType Objects Can Use Diffe rent Protocols to Retrieve Data
Advantages of Using DBUri and XDBUri
UriType Values Store Uri-References
Advantages of Using UriType Values
UriType Functions
HttpUriType Functions
getContentType() Fun ction
getXML() Function
DBUri , Intra-Database References
Formulating the DBUri
Notation for DBUriType Fragments
DBUri Syntax Guidelines
Using Predicate (XPath) Expressions in DBUris
Some Common DBUri Scenarios
Identifying the Who le Table
Identifying a Particular Row of the Table
Identifying a Target Column
Retrieving the Text Value of a Column
How DBUris Differ from Object References
DBUri Applies to a Database and Session
Where Can DBUri Be Used?
DBUriType Functions
XDBUriType
How to Create an Instance of XDBUriType
Crea ting Oracle Text Indexes on UriType Columns
Using UriType Objects
< dd>
Storing Pointers to Documents with UriType
Using the Substitution Mechanism
Creating Instances of UriType Objects with the UriFactory Package
Registering New UriType Subtypes with t he UriFactory Package
Why Define New Subtypes of UriType?
SYS_DBURIGEN() SQL Function
Rules for Passing C olumns or Object Attributes to SYS_DBURIGEN()
SYS_DBURIGEN Examples
Turning a URL into a Database Query with DBUri Servlet
DBUri Servlet Mechanism
DBUri Servlet: Optional Arguments< /a>
Installing DBUri Servlet
DBUr i Security
Configuring the UriFactory Package to Handle DBUris
Part V Oracle XML DB Repository: Foldering, Securi ty, and Protocols
18
Accessing Oracle XML DB Repository Data
Introducing Oracle XML DB Foldering
Oracle XML DB Repository
Repository Terminology
Current Repository Folder List
< /dl>
Oracle XML DB Resources
Where Exactly Is Repository Data Stored?
Generated Table Names
Defining Structured Storage for Resources
Path-Name Resolution
Deleting Resources
Accessing Oracle XML DB Repository Resources
Navigational or Path Acc ess
Accessing Oracle XML DB Resources Using Internet Protocols
Where You Can Use Oracle XML DB Protocol Access
Protocol Access Calling Sequence
Retrieving Oracle XML DB Resourc es
Storing Oracle XML DB Resources
Using Internet Protocols and XMLType: XMLType Direct Stream Write
Configuring Default Namespace to Schema Location Mappings
Configuring XML File Extens ions
Query-Based Access
Accessing Repos itory Data Using Servlets
Accessing Data Stored in Oracle XML DB Repository Resou rces
Managing and Controlling Access to Resources
Setting and Accessing Custom Namespace Properties
19
Managing Oracle XML DB Resource Versions
Introducing Oracle XML DB Versioning
Oracle XML& nbsp;DB Versioning Features
Oracle XML DB Versioning Terms Used in This Chapter a>
Oracle XML DB Resource ID and Path Name
Creating a Version-Controlled Resource (VCR)
Version Resource or VCR Version
Resource ID of a New Version
Accessing a Version-Controlled Resource (VCR)
Updating a Version-Controlled Reso urce (VCR)
Checkout
Checkin a>
Uncheckout
Update Contents and Propertie s
Access Control and Security of VCR
Guidelines for Using Oracle XML DB Versioning
20
SQL Access Using RESOURCE_VIEW and PATH_VIEW
Oracle XML DB RESOURCE_VIEW and PATH_VIEW
RESOURCE_VIEW Definition and Structure
PATH_VIEW Definition and Structure
Understanding the Difference Between RESOURCE_VIEW and PATH_VIEW
Operations You Can Perform Using UNDER_PATH and EQUALS_PATH
Resource_View and Path_View APIs
UNDER_PATH
EQUALS_PATH
PATH
DEPTH
< dd>
Using the Resource View and Path View API
Accessing Repository Data Paths, Resources and Links: Examples
Inserting Data into a Repository Resource: Examples
Deleting Repository Resources: Examples
Deleting Non-Empty Containers Recursively
Updating Repository Resources: Examples
Working with Multiple Oracl e XML DB Resources Simultaneously
Performance Tuning of XML DB
Searching for Resources Using Oracle Text
21
PL/SQL Access and Management of Data Using DBMS_XDB
Introducing Oracle XML DB Resource API for PL/SQL
Overview of DBMS_XDB
DBMS_XDB: Oracle XML DB Resource Management
Using DBMS_XDB to Manage Resources, Calling Sequence
DBMS_XDB: Oracle XML DB ACL-Based Security Management
Using DBMS_XDB to Manage Security, Calling Sequence
DBMS_XDB: Ora cle XML DB Configuration Management
Using DBMS_XDB for Configuration Ma nagement, Calling Sequence
22 Java Access to Repository Data Using Resource API for Java
Introducing Oracle XML DB Resource API for Java
Using Oracle XML&nb sp;DB Resource API for Java
Oracle XML DB Resource API for Java Parameters
Oracle XML DB Resource API for Java: Examples
23
Oracle XML DB Resource Security
h3>
Introducing Oracle XML DB Resource Security and ACLs
How the ACL-Based Security Mechanism Works
Rela tionship Between ACLs and Resources
Access Control List Concepts a>
Oracle XML DB Supported Privileges
Atomic Privileges
Aggregate Privileges
Interaction with Database Table Security
Working with Oracle XML&n bsp;DB ACLs
Creating an ACL Using DBMS_XDB.createResource()
Setting the ACL of a Resource
Deleting an ACL
Updating an ACL
Updating the Entire AC L or Adding or Deleting an Entire ACE
Updating Existing ACE(s)
Retrieving the ACL Document for a Given Resource
Ret rieving Privileges Granted to the Current User for a Particular Resource
Checking if t he Current User Has Privileges on a Resource
Checking if the Current User Has Privileg es With the ACL and Resource Owner
Retrieving the Path of the ACL that Protects a Give n Resource
Retrieving the Paths of all Resources Protected by a Given ACL
Integration with LDAP
Performance Issues for Using ACLs
24< /span> FTP, HTTP, and WebDAV Access to Repository Data
Introducing Oracle XML DB Protocol Server
Session Pooling
HTTP Performance is Improved
Java Servlets
Oracle XML DB Protocol Server Configuration Management
< a href="xdb22pro.htm#sthref1836">Configuring Protocol Server Parameters
Interaction wi th Oracle XML DB File System Resources
Protocol Server Handles XML Schema-Based o r Non-Schema-Based XML Documents
Event-Based Logging
Using FTP and Oracle XML DB Protocol Server
Ora cle XML DB Protocol Server: FTP Features
Non-Supported FTP Features
Using FTP on Standard or Non-Standard Ports
FTP Server Session Management
Controlling Character Sets for FTP
Handling Error 421. Modifying the FTP Session's Default Timeout Value
Using HTTP and Oracle XML DB Protocol Server
Oracle XML DB Protocol Server: HTTP Features
Non-Supported HTTP F eatures
Using HTTP on Standard or Non-Standard Ports
HTTP Server and Java Servlets
Sending Multibyte Data From a Client
dd>
Non-Ascii Characters in URLs
Controlling Cha racter Sets for HTTP
Using WebDAV and Oracle XML DB
Oracle XML DB WebDAV Features
Non-Supported WebDAV Features
Using Oracle XML DB and WebDAV: Cr eating a WebFolder in Windows 2000
25
Writing Oracle XML DB Applications in Java
Introducing Oracle XML DB Java Applications
Which Oracle XML DB APIs Are Available Inside and Outside the Database?
Design Guidelin es: Java Inside or Outside the Database?
HTTP: Accessing Java Servlets or Di rectly Accessing XMLType Resources
Accessing Many XMLType Object Elements: Use JDBC XM LType Support
Use the Servlets to Manipulate and Write Out Data Quickly as XML
Writing Oracle XML DB HTTP Servlets in Java
Configuring Oracle XML DB Servlets
HTTP Request Processing for Oracl e XML DB Servlets
The Session Pool and XML DB Servlets
Native XML Stream Support
Oracle XML DB Servlet APIs
Oracle XML DB Servlet Example
I nstalling the Oracle XML DB Example Servlet
Configuring the Oracle XML DB Ex ample Servlet
Testing the Example Servlet
Part VI Oracle Tools that Support Oracle XML DB
26
Managing Oracle XML DB U sing Oracle Enterprise Manager
Introducing Oracle XML DB and Oracle E nterprise Manager
Getting Started with Oracle Enterprise Manager and Oracle XML DB
Enterprise Manager: Installing Oracle XML DB
< a href="xdb24oem.htm#sthref1927">You Must Register Your XML Schema with Oracle XML DB
Oracle Enterprise Manager Oracle XML DB Features
Configure Oracle XML DB
Create and Manage Resources
Manage XML Schema and Related Database Objects
The Ente rprise Manager Console for Oracle XML DB
XML Database Management Window : Right-Hand Dialog Windows
Hierarchical Navigation Tree: Navigator
Configuring Oracle XML DB with Enterprise Manager
Viewing or Editing Oracle XML DB Configuration Parameters
Category: Generic
Category: FTP
Ca tegory: HTTP
Creating and Managing Oracle XML DB Resources wi th Enterprise Manager
Administering Individual Resources
General Resources Page
Security Page
Individual Resource Content Menu
Create Resource
Grant Privileges On...
Show Contents
Show Grantee
Enterprise Manager and Oracle XML DB: ACL Security
Granting and Revoking User Pr ivileges with User > XML Tab
Resources List
Available Privileges List
Granted List
XML Database Resource Privileges
Managing XML Sc hema and Related Database Objects
Navigating XML Schema in Enterprise Manage r
Registering an XML Schema
G eneral Page
Options Page
Creating Structured Storage Infrastructure Based on XML Schema
Creatin g Tables
Creating Views
Creating Functi on-Based Indexes
Creating an XMLType Table
Creating Tables with XMLType Columns
Creating a View Based on XML Schema
Creating a Function-Based Index Based on XPath Expressions
27
Loading XML Data into Oracle XML&n bsp;DB Using SQL*Loader
Loading XMLType Data into Oracle Database
Restoration
Using SQL*Loade r to Load XMLType Data
Using SQL*Loader to Load XMLType Data in LOBs
Loading LOB Data in Predetermined Size Fields
Loading LOB Data in Delimited Fields
Loading LOB Data from LOBFILEs
Dynamic Versus Static LOBFILE Specifications
Using SQL*Loader to Load XMLType Data Directly From the Control File
Loading Very Large XML Documents into Oracle Database
28
Importing and Exporting XMLType Tables
Overview of IMPORT/EXPORT Support in Oracle XML DB
Resource s and Foldering Do Not Fully Support IMPORT/EXPORT
Non-XML Schema-Based XMLT ype Tables and Columns
XML Schema-Based XMLType Tables
Guidelines for Exporting Hierarchy-Enabled Tables
IMPORT/EXPORT Syntax and Examples
User Level Import/Export
Table Mode Export
Metadata in Repository is No t Exported During a Full Database Export
Importing and Exporting with Different Charac ter Sets
Part VII XML Data Exchange Usin g Oracle Streams Advanced Queuing
29 Exchanging XML Data With Oracle Streams AQ
What Is Oracle Streams Advanced Queuing?
How Do AQ and XML Complement Each Other?
< dd>
AQ and XML Message Payloads
AQ Enables Hu b-and-Spoke Architecture for Application Integration
Messages Can Be Retained for Audit ing, Tracking, and Mining
Advantages of Using AQ
Oracle Streams and AQ
Streams Message Queuing
XMLType Attributes in Object Types
Internet Data Access Presentation (iDAP)
iDAP Architecture
XMLType Queue Payloads
Guidelines for Using XML and Oracle Streams Advanced Queuing
Storing Oracle Streams AQ XML Messages with Many PD Fs as One Record?
Adding New Recipients After Messages Are Enqueued
Enqueuing and Dequeuing XML Messages?
Parsing Messages with XML Content from Oracle Streams AQ Queues
Preventing the Listener from Stopping Until t he XML Document Is Processed
Using HTTPS with AQ
Storing XML in Oracle Streams AQ Message Payloads
Comparing iDAP and SOAP
dd>
A
Installi ng and Configuring Oracle XML DB
Installing Oracle XML DB
Installing or Reinstalling Oracle XML DB From Scratch
Installing a New Oracle XML DB With Database Configuration Assistant
Dynamic Protocol Registration Registers FTP and HTTP Services with Local Listener
Installing a New Oracle XML DB Manually Without Database Configuration Assistant
< a href="appaman.htm#sthref2131">Postinstallation
Reinstalling Oracle XML  ;DB
Upgrading an Existing Oracle XML DB Installation
Upgrading Oracle XML DB From Release 9.2 to 10
g
Release 1 (10.1)
Privileges for Nested XMLType Tables When Upgrading to Oracle Database 10
g
dl>
Configuring Oracle XML DB
Oracle XML DB Configuration File, xdbconfig.xml
Top Level Tag <xdbcon fig>
<sysconfig>
<userconfig& gt;
<protocolconfig>
<httpconfig >
Oracle XML DB Configuration Example
Oracle XML DB Configuration API
Get Configuration, cfg_ge t()
Update Configuration, cfg_update()
Re fresh Configuration, cfg_refresh()
B
XML Schema Primer
XML Schema and Oracle XML DB
Namespaces
XML Sche ma and Namespaces
XML Schema Can Specify a targetNamespace Attribute
XML Instance Documents Declare Which XML Schema to Use in Their Root Element
schemaLocation Attribute
noNamespaceSch emaLocation Attribute
Declaring and Identifying XML Schema Namespaces
Registering an XML Schema
Oracle XML&n bsp;DB Creates a Default Table
Deriving an Object Model: Mapping the XML Schema Constru cts to SQL Types
Oracle XML DB and DOM Fidelity
Annotating an XML Schema
Identifying and Processing Instance Docu ments
Introducing XML Schema
Purchase Order, po.xml
Association Between the Instance Document and Purchase O rder Schema
Purchase Order Schema, po.xsd
Purchase Order Schema, po.xsd
Prefix xsd:
< a href="appbsch.htm#sthref2184">XML Schema Components
Primary Components
< /dd>
Secondary Components
Helper Components
Complex Type Definitions, Element and Attribute Declarations
Defining the USAddress Type
Defining PurchaseOrderType
Occurrence Constraints: minOccurs and maxOccurs
D efault Attributes
Default Elements
Global Elements and Attributes
Naming Conflicts
Simple Types
List Types
Creating a List of myInteger
Union Types
Anonymous Type Definitions
Two Anonymous Type Definit ions
Element Content
Complex Types from Simple Types
Mixed Content
Empty Content
AnyType
Anno tations
Building Content Models
Attribute Groups
Adding Attributes to the Inline Type Definition
Adding Attributes Using an Attribute Group
Nil Value s
How DTDs and XML Schema Differ
DTD Limitations
XML Schema Features Compared to DTD Features
Converting Existing DTDs to XML Schema?
XML Schema Exam ple, PurchaseOrder.xsd
C
XPath and Namespace Primer
Introducing the W3C XML Path Langua ge (XPath) 1.0 Recommendation
XPath Models an XML Document as a Tree of Nodes
The XPath Expression
Evaluating Expressions with Respect to a Context
Evaluating Subexpressions a>
XPath Expressions Often Occur in XML Attributes
Location Paths
Location Path Syntax Abbreviations a>
Location Path Examples Using Unabbreviated Syntax
Location Path Examples Using Abbreviated Syntax
Attribute Abbreviatio n @
Path Abbreviation //
Location Step Ab breviation .
Location Step Abbreviation ..
Abbreviation Summary
Relative and Absolute Location Paths
Location Path Syntax Summary
XPath 1.0 Data Mode l
Nodes
Root Nodes
Element Nodes
Text Nodes
Attribute Nodes
Namespace Nodes
Processing Instruction Nodes
Comment Nodes
Expanded-Name
Document Order
Introducing the W3C Namespaces in XML Recommendation
What Is a Namespace?
URI References
Notation and Usage
Declaring Namespaces
Attribute Names for Namespace Declaration
When the Attribute Name Matches the PrefixedAttName
When the Attribute Name Matches the DefaultAttName
Namespace Constraint: Leading "XML"
Qualified Names
Qualified Name Syntax
What is the Prefix?
Using Qualified Names
Element Types
Attribute
Namespace Constraint: Prefix Declared
Qualified Names in Declarations a>
Applying Namespaces to Elements and Attributes
Namespace Scoping
Namespace Defaulting
Uniqueness of Attributes
Conformance of XML Documents
Introducing the W3C XML Information Set
Name spaces
Entities
End-o f-Line Handling
Base URIs
Unknown and No Value
Synthetic Infosets
< font face="arial, helvetica, sans-serif">
D
XSLT Primer
Introducing XSL
The W3C XSL Transformation Recommendation Version 1.0
Namespaces in XML
XSL Style-Sheet Archit ecture
XSL Transformation (XSLT)
XML Path Language (Xpath)
CSS Versus XSL
XSL Style-Sheet Example, PurchaseOrder.xsl
E
Java APIs: Quick Reference
Java DOM AP I For XMLType (oracle.xdb and oracle.xdb.dom Classes)
Java Methods Not Suppo rted
Oracle XML DB Resource API for Java (oracle.xdb.spi Classes)
dd>
Oracle Database 10
g
Release 1 (10.1): New Java APIs
New methods to Manage Node Values Added to XDBNode.java
Jav a DOM APIs to Manage an Attribute Added to XDBAttribute.java
New Java XMLType APIs
F
SQ L and PL/SQL APIs: Quick Reference
XMLType API
PL/SQL DOM API for XMLType (DBMS_XMLDOM)
PL/SQL Parser for XMLType (DBMS_XMLPARSER)
PL/SQL XSLT Processor for XMLType (DBMS_XSLPROCESSOR)
< a href="appfspe2.htm#sthref2361">DBMS_XMLSCHEMA
Oracle XML DB XML Schema Catalog Views
Resource API for PL/SQL (DBMS_XDB)
DBMS_XMLGEN
RESOURCE_VIEW, PATH_VIEW
DBMS_XDB_VERSION
DBMS_XDBT
New PL/SQL A PIs to Support XML Data in Different Character Sets
G
C API for XML (Oracle XML DB): Quick Reference
XML Context
OCIXmlDbFreeXmlCtx() Syntax
OCIXmlDbInitXmlCtx() Syntax
H
Oracle XML DB-Supplied XML Schemas and Additional Examples
RESOURCE_VIEW and PATH_VIEW Database and XML Schema
RESOURCE_VIEW Definition and Structure
PATH_VIEW Definition and Structure
XDBResource.xsd: XML Schema for Representing Oracle XML DB Re sources
XDBResource.xsd
acl.xsd: XML Schema for Representing Oracle XML DB ACLs
ACL Represent ation XML Schema, acl.xsd
acl.xsd
xdbconfig.xsd: XML Schema for Configuring Oracle XML DB
xdbconfig.xsd
Loading XML Using C (OCI)
I
Oracle XML DB Feature Summary
Oracle XML DB Feature Summary
XMLTyp e Features
Oracle XML DB Repository Features
Standards Supported
Oracle XML DB Limitations
Index