Skip Headers
Oracle® XML DB Developer's Guide
10
g
Release 2 (10.2)
Part Number B14259-02
Home
Book List
Index
Master Index
Contact Us
Next
View PDF
Contents
List of Examples
List of Figures
List of Tables
Title and Copyright Information
Preface
Audience
Documentation Accessibility
Structure
Related Documents
Conventions
What's New In Oracle XML DB?
Oracle Database 10g Release 2 (10.2) New Features in Oracle XML DB
Oracle Database 10g Release 1 (10.1) New Features in Oracle XML DB
Oracle Text Enhancements
Oracle Streams Advanced Queuing (AQ) Support
Oracle XDK Support for XMLType
Part I Oracle XML DB Basics
1
Introduction to Oracle XML DB
Features of Oracle XML DB
Oracle XML DB Architecture
XMLType Storage
APIs for XML
XML Schema Catalog Views
Views RESOURCE_VIEW and PATH_VIEW
Overview of Oracle XML DB Repository
Accessing and Manipulating XML in the Oracle XML DB Repository
XML Services
Oracle XML DB Repository Architecture
How Does Oracle XML DB Repository Work?
Oracle XML DB Protocol Architecture
Programmatic Access to Oracle XML DB (Java, PL/SQL, and C)
Oracle XML DB Features
XMLType Datatype
XML Schema Support
Structured Versus Unstructured Storage
XML/SQL Duality
SQL/XML INCITS Standard SQL Functions
Rewriting of XPath Expressions: XPath Rewrite
Oracle XML DB Benefits
Unifying Data and Content with Oracle XML DB
Exploiting Database Capabilities
Exploiting XML Capabilities
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
Searching XML Data Stored in CLOBs Using Oracle Text
Building Messaging Applications using Oracle Streams Advanced Queuing
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
Oracle XML DB Installation
When to Use Oracle XML DB
Designing Your XML Application
Oracle XML DB Design Issues: Introduction
A. Data
B. Access
C. Application Language
D. Processing
E. Storage
Oracle XML DB Application Design: A. How Structured Is Your Data?
XML Schema-Based or Non-Schema-Based
Oracle XML DB Application Design: B. Access Models
Oracle XML DB Application Design: C. Application Language
Oracle XML DB Application Design: D. Processing Models
Messaging Options
Oracle XML DB Application Design: F. 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 Schema
Reduced Bottlenecks From Code That Is Not Native
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
Two Ways to Store XMLType Data: LOBs and Structured
Advantages and Disadvantages of XML Storage Options in Oracle XML DB
When to Use CLOB Storage for XMLType
Creating XMLType Tables and Columns
Loading XML Content into Oracle XML DB
Loading XML Content Using SQL or PL/SQL
Loading XML Content Using Java
Loading XML Content Using C
Loading Large XML Files That Contain Small XML Documents
Loading Large XML Files Using SQL*Loader
Loading XML Documents into the Repository Using DBMS_XDB
Loading Documents into the Repository Using Protocols
Character Sets of XML Documents
XML Encoding Declaration
Character-Set Determination When Loading XML Documents into the Database
Character-Set Determination When Retrieving XML Documents from the Database
Overview of the W3C XML Schema Recommendation
XML Instance Documents
XML Schema for Schemas
Editing XML Schemas
XML Schema Features
Text Representation of the PurchaseOrder XML Schema
Graphical Representation of the Purchase-Order XML Schema
Using XML Schema with 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 in the Database
Structured Storage of XML Documents
Annotating an XML Schema to Control Naming, Mapping, and Storage
Controlling 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 Types and Tables Created During XML Schema Registration
Working with Large XML Schemas
Working with Global Elements
Creating XML Schema-Based XMLType Columns and Tables
Default Tables
Identifying XML Schema Instance Documents
Attributes noNamespaceSchemaLocation and schemaLocation
Dealing with Multiple Namespaces
Using the Database to Enforce XML Data 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
XPath and Oracle XML
Querying XML Content Stored in Oracle XML DB
PurchaseOrder XML Document
Retrieving the Content of an XML Document Using Pseudocolumn OBJECT_VALUE
Accessing Fragments or Nodes of an XML Document Using EXTRACT
Accessing Text Nodes and Attribute Values Using EXTRACTVALUE
Invalid Use of EXTRACTVALUE
Searching the Content of an XML Document Using EXISTSNODE
Using EXTRACTVALUE and EXISTSNODE in a WHERE Clause
Using XMLSEQUENCE to Perform SQL Operations on XMLType Fragments
Relational Access to XML Content Stored in Oracle XML DB Using Views
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-Specific SQL Functions
Understanding and Optimizing XPath Rewrite
Using EXPLAIN PLAN to Tune XPath Rewrites
Using Indexes to Improve Performance of XPath-Based Functions
Optimizing Operations on Collections
Using Indexes to Tune Queries on Collections Stored as Nested Tables
EXPLAIN PLAN with ACL-Based Security Enabled: SYS_CHECKACL() Filter
Accessing Relational Database Content Using XML
Generating XML From Relational Tables Using DBURIType
XSL Transformation and Oracle XML DB
Using Oracle XML DB Repository
Installing and Uninstalling Oracle XML DB Repository
Oracle XML DB Provides Name-Level Locking
Use Protocols or SQL to Access and Process Repository Content
Using Standard Protocols to Store and Retrieve Content
Uploading Content Into Oracle XML DB Using FTP
Accessing Oracle XML DB Repository Programmatically
Accessing and Updating XML Content in the Repository
Accessing the Content of Documents Using SQL
Accessing the Content of XML Schema-Based Documents
Using the XMLRef Element in Joins to Access Resource Content in the Repository
Updating the Content of Documents Stored in the Repository
Updating Repository Content Using Protocols
Updating Repository Content Using SQL
Updating XML Schema-Based Documents in the Repository
Controlling Access to Repository Data
Oracle XML DB Transactional Semantics
Querying Metadata and the Folder Hierarchy
RESOURCE_VIEW and PATH_VIEW
Querying Resources in RESOURCE_VIEW and PATH_VIEW
Oracle XML DB Hierarchical Index
How Documents are Stored in the Repository
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
Selecting and Querying XML Data
Pretty-Printing of Results
Searching XML Documents with XPath Expressions
Oracle Extension XPath Function Support
Selecting XML Data Using XMLType Methods
Querying XMLType Data with SQL Functions
EXISTSNODE SQL Function
Using Indexes to Evaluate EXISTSNODE
EXTRACT SQL Function
EXTRACTVALUE SQL Function
Use EXTRACTVALUE for Convenience
EXTRACTVALUE Characteristics
Querying XML Data With SQL
Updating XML Instances and XML Data in Tables
Updating an Entire XML Document
SQL Functions to Update XML Data
UPDATEXML SQL Function
UPDATEXML and NULL Values
Updating the Same XML Node More Than Once
Preserving DOM Fidelity When Using UPDATEXML
Optimization of SQL Functions that Modify XML
Creating Views of XML with SQL Functions that Modify XML
INSERTCHILDXML SQL Function
INSERTXMLBEFORE SQL Function
APPENDCHILDXML SQL Function
DELETEXML SQL Function
Indexing XMLType Columns
XPath Rewrite for Indexes on Singleton Elements or Attributes
Creating B-Tree Indexes on the Contents of a Collection
Creating Function-Based Indexes on XMLType Tables and Columns
CTXXPATH Indexes on XMLType Columns
CTXXPATH Indexing Features
Creating CTXXPATH 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
CTXXPATH Indexes On XML Schema-Based XMLType Tables
Determining Whether an Index is Being Used: Tracing
CTXXPATH Indexing Depends on Storage Options and Document Size
Oracle Text Indexes on XMLType Columns
5
XML Schema Storage and Query: Basic
Overview of XML Schema and Oracle XML DB
Using Oracle XML DB and XML Schema
Why We Need XML Schema
XML Schema Provides Flexible XML-to-SQL Mapping Setup
XML Schema Allows XML Instance Validation
DTD Support in Oracle XML DB
Inline DTD Definitions
External DTD Definitions
Managing XML Schemas with DBMS_XMLSCHEMA
Registering an XML Schema
Schema Registration Considerations
Storage and Access Infrastructure
Transactional Action of XML Schema Registration
Managing and Storing XML Schemas
Debugging XML Schema Registration
SQL Object Types
Creating Default Tables During XML Schema Registration
Generated Names are Case Sensitive
Objects That Depend on Registered XML Schemas
How to Obtain a List of Registered XML Schemas
Deleting an XML Schema with DBMS_XMLSCHEMA.DELETESCHEMA
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 Columns Based on XML Schema
Specifying Unstructured (LOB-Based) Storage of Schema-Based XMLType
Specifying Storage Models for Structured Storage of Schema-Based XMLType
Specifying Relational Constraints on XMLType Tables and Columns
Oracle XML Schema Annotations
Querying a Registered XML Schema to Obtain Annotations
SQL Mapping Is Specified in the XML Schema During Registration
Mapping Types with DBMS_XMLSCHEMA
Setting Attribute Mapping Type Information
Overriding the SQLType Value in XML Schema When Declaring Attributes
Setting Element Mapping Type Information
Overriding the SQLType Value in XML Schema When Declaring Elements
Mapping simpleType to SQL
simpleType: Mapping XML Strings to SQL VARCHAR2 Versus CLOBs
Working with Time Zones
Using Trailing Z to Indicate UTC Time Zone
Mapping complexType to SQL
Specifying Attributes in a complexType XML Schema Declaration
6
XPath Rewrite
Overview of XPath Rewrite
Where Does XPath Rewrite Occur?
Which XPath Expressions Are Rewritten?
Common XPath Constructs Supported in XPath Rewrite
Unsupported XPath Constructs in XPath Rewrite
Common XMLSchema Constructs Supported in XPath Rewrite
Unsupported XML Schema Constructs in XPath Rewrite
Common Storage Constructs Supported in XPath Rewrite
Unsupported Storage Constructs in XPath Rewrite
XPath Rewrite Can Change Comparison Semantics
How Are XPath Expressions Rewritten?
Rewriting XPath Expressions: Mapping Types and Path Expressions
Schema-Based: Mapping for a Simple XPath
Schema-Based: Mapping for simpleType Elements
Schema-Based: Mapping of Predicates
Schema-Based: Document Ordering with Collection Traversals
Schema-Based: Collection Position
Schema-Based: XPath Expressions That Cannot Be Satisfied
Schema-Based: Namespace Handling
Schema-Based: Date Format Conversions
Existential Checks for Attributes and Elements with Scalar Values
Diagnosing XPath Rewrite
Using EXPLAIN PLAN with XPath Rewrite
Using Events with XPath Rewrite
Turning Off Functional Evaluation (Event 19021)
Tracing Reasons that Rewrite Does Not Occur
XPath Rewrite of SQL Functions
XPath Rewrite for EXISTSNODE
EXISTSNODE Mapping with Document Order Preserved
EXISTSNODE Mapping Without Document Order Preserved
XPath Rewrite for EXTRACTVALUE
XPath Rewrite for EXTRACT
EXTRACT Mapping with Document Order Maintained
EXTRACT Mapping Without Maintaining Document Order
XPath Rewrite for XMLSEQUENCE
XPath Rewrite for UPDATEXML
XPath Rewrite for INSERTCHILDXML and DELETEXML
7
XML Schema Storage and Query: Advanced
Generating XML Schemas with DBMS_XMLSCHEMA.GENERATESCHEMA
Adding Unique Constraints to the Parent Element of an Attribute
Setting Attribute SQLInline to false for Out-of-Line Storage
XPath Rewrite for Out-Of-Line Tables
Storing Collections in Out-Of-Line Tables
Out-of-Line Storage: Using an Intermediate Table to Store the List of References
Fully Qualified XML Schema URLs
Mapping XML Fragments to Large Objects (LOBs)
complexType Extensions and Restrictions in Oracle XML DB
complexType Declarations in XML Schema: Handling Inheritance
Mapping complexType: simpleContent to Object Types
Mapping complexType: Any and AnyAttributes
Oracle XPath Extension Functions to Examine Type Information
ora:instanceof-only XPath Function
ora:instanceof XPath Function
XML Schema: Working With Circular and Cyclical Dependencies
For Circular XML Schema Dependencies Set GenTables Parameter to TRUE
Handling Cycling Between complexTypes in XML Schema
How a complexType Can Reference Itself
Cyclical References Between XML Schemas
Guidelines for Using XML Schema with Oracle XML DB
Using Bind Variables in XPath Expressions
Constraints on Repetitive Elements in Schema-Based XML
Loading and Retrieving Large Documents with Collections
Guidelines for Setting xdbcore Parameters
8
XML Schema Evolution
Overview of XML Schema Evolution
Limitations of Procedure DBMS_XMLSCHEMA.COPYEVOLVE
Guidelines for Using Procedure DBMS_XMLSCHEMA.COPYEVOLVE
Top-Level Element Name Changes
Ensure that the XML Schema and Dependents are Not Used by Concurrent Sessions
Rollback When Procedure DBMS_XMLSCHEMA.COPYEVOLVE Raises an Error
Failed Rollback From Insufficient Privileges
Privileges Needed for XML Schema Evolution
Revised Purchase-Order XML Schema
Style Sheet to Update Existing Instance Documents
Procedure DBMS_XMLSCHEMA.COPYEVOLVE: Parameters and Errors
Using Procedure DBMS_XMLSCHEMA.COPYEVOLVE
9
Transforming and Validating XMLType Data
Transforming XMLType Instances
XMLTRANSFORM and XMLType.transform()
XMLTRANSFORM and XMLType.transform() Examples
Validating XMLType Instances
XMLIsValid
schemaValidate
isSchemaValidated
setSchemaValidated
isSchemaValid
Validating XML Data Stored as XMLType: Examples
10
Full-Text Search Over XML
Overview of Full-Text Search for XML
Comparison of Full-Text Search and Other Search Types
XML search
Search using Full-Text and XML Structure
About the Full-Text Search Examples
Roles and Privileges
Schema and Data for Full-Text Search Examples
Overview of CONTAINS and ora:contains
Overview of SQL Function CONTAINS
Overview of XPath Function ora:contains
Comparison of CONTAINS and ora:contains
CONTAINS SQL Function
Full-Text Search Using Function CONTAINS
Boolean Operators: AND, OR, NOT
Stemming: $
Combining Boolean and Stemming Operators
SCORE SQL Function
Structure: Restricting the Scope of a CONTAINS Search
WITHIN Structure Operator
INPATH Structure Operator
HASPATH Structure Operator
Structure: Projecting the CONTAINS Result
Indexing with the CONTEXT Index
Introduction to the CONTEXT Index
Effect of the CONTEXT Index on CONTAINS
CONTEXT Index: Preferences
Introduction to Section Groups
ora:contains XPath Function
Full-Text Search Using Function ora:contains
Structure: Restricting the Scope of an ora:contains Query
Structure: Projecting the ora:contains Result
Policies for ora:contains Queries
Introduction to Policies for ora:contains Queries
Effect of Policies on ora:contains
Policy Defaults
ora:contains Searches Over a Collection of Elements
ora:contains Performance
Use a Primary Filter in the Query
Use a CTXXPATH Index
XPath Rewrite and the CONTEXT Index
Text Path BNF Specification
Support for Full-Text XML Examples
Purchase-Order XML Document, po001.xml
CREATE TABLE Statements
Purchase-Order XML Schema for Full-Text Search Examples
Part III Using APIs for XMLType to Access and Operate on XML
11
PL/SQL API for XMLType
Overview of PL/SQL APIs for XMLType
API Features
Lazy Loading of XML Data (Lazy Manifestation)
XMLType Datatype Supports XML Schema
XMLType Supports Data in Different Character Sets
PL/SQL DOM API for XMLType (DBMS_XMLDOM)
Overview of the W3C Document Object Model (DOM) Recommendation
Oracle XDK Extensions to the W3C DOM Standard
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 Oracle XDK and Oracle XML DB
Using PL/SQL DOM API for XMLType: Preparing XML Data
Defining an XML Schema Mapping to SQL Object Types
DOM Fidelity for XML Schema Mapping
Wrapping Existing Data into XML with XMLType Views
DBMS_XMLDOM Methods Supported
PL/SQL DOM API for XMLType: Node Types
Working with Schema-Based XML Instances
DOM NodeList and NamesNodeMap Objects
Using PL/SQL DOM API for XMLType (DBMS_XMLDOM)
PL/SQL DOM API for XMLType – Examples
PL/SQL Parser API for XMLType (DBMS_XMLPARSER)
PL/SQL Parser API for XMLType: Features
Using PL/SQL Parser API for XMLType (DBMS_XMLPARSER)
PL/SQL XSLT Processor for XMLType (DBMS_XSLPROCESSOR)
Enabling Transformations and Conversions with XSLT
PL/SQL XSLT Processor for XMLType: Features
Using PL/SQL Parser API for XMLType (DBMS_XSLPROCESSOR)
12
Package DBMS_XMLSTORE
Overview of PL/SQL Package DBMS_XMLSTORE
Using Package DBMS_XMLSTORE
Inserting with DBMS_XMLSTORE
Updating with DBMS_XMLSTORE
Deleting with DBMS_XMLSTORE
13
Java API for XMLType
Overview of Java DOM API for XMLType
Java DOM API for XMLType
Accessing XML Documents in Repository
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 Programmatically
Creating XML Schema-Based Documents
JDBC or SQLJ
Java DOM API for XMLType Classes
Java Methods Not Supported
Using Java DOM API for XMLType
14
Using the C API for XML
Overview of the C API for XML (XDK and Oracle XML DB)
Using OCI and the C API for XML with Oracle XML DB
XML Context Parameter
OCIXmlDbInitXmlCtx() Syntax
OCIXmlDbFreeXmlCtx() Syntax
Initializing and Terminating an XML Context
OCI Usage
Accessing XMLType Data From the Back End
Creating XMLType Instances on the Client
Common XMLType Operations in C
15
Using Oracle Data Provider for .NET with Oracle XML DB
ODP.NET XML Support and Oracle XML DB
ODP.NET Sample Code
Part IV Viewing Existing Data as XML
16
Generating XML Data from the Database
Oracle XML DB Options for Generating XML Data From Oracle Database
Overview of Generating XML Using Standard SQL/XML Functions
Overview of Generating XML Using Oracle Database SQL Functions
Overview of Generating XML Using DBMS_XMLGEN
Overview of Generating XML with XSQL Pages Publishing Framework
Overview of Generating XML Using XML SQL Utility (XSU)
Overview of Generating XML Using DBURIType
Generating XML Using SQL Functions
XMLELEMENT and XMLATTRIBUTES SQL Functions
Escaping Characters in Generated XML Data
Formatting of XML Dates and Timestamps
XMLElement Examples
XMLFOREST SQL Function
XMLSEQUENCE SQL Function
XMLCONCAT SQL Function
XMLAGG SQL Function
XMLPI SQL Function
XMLCOMMENT SQL Function
XMLROOT SQL Function
XMLSERIALIZE SQL Function
XMLPARSE SQL Function
XMLCOLATTVAL SQL Function
XMLCDATA SQL Function
Generating XML Using DBMS_XMLGEN
Using DBMS_XMLGEN
Functions and Procedures of Package DBMS_XMLGEN
DBMS_XMLGEN Examples
Generating XML Using SQL Function SYS_XMLGEN
Using XMLFormat Object Type
Generating XML Using SQL Function SYS_XMLAGG
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, EXTRACT, and TABLE to Return a Rowset
17
Using XQuery with Oracle XML DB
Overview of XQuery in Oracle XML DB
Overview of the XQuery Language
Functional Language Based on Sequences
XQuery Expressions
FLWOR Expressions
SQL Functions XMLQuery and XMLTable
XMLQUERY SQL Function in Oracle XML DB
XMLTABLE SQL Function in Oracle XML DB
Predefined Namespaces and Prefixes
Oracle XQuery Extension Functions
ora:contains XQuery Function
ora:matches XQuery Function
ora:replace XQuery Function
ora:sqrt XQuery Function
ora:view XQuery Function
XMLQuery and XMLTable Examples
XQuery Is About Sequences
Using XQuery to Query XML Data in Oracle XML DB Repository
Using ora:view to Query Relational Data in XQuery Expressions
Using XQuery with XMLType Data
Using Namespaces with XQuery
Performance Tuning for XQuery
XQuery Optimization over a SQL/XML View Created by ora:view
XQuery Optimization over XML Schema-Based XMLType Data
XQuery Static Type-Checking in Oracle XML DB
SQL*Plus XQUERY Command
Using XQuery with PL/SQL, JDBC, and ODP.NET
Oracle XML DB Support for XQuery
Support for XQuery and SQL
Implementation Choices Specified in the XQuery Standard
Implementation Departures from the XQuery Standard
XQuery Optional Features
Support for XQuery Functions and Operators
XQuery Functions doc and collection
18
XMLType Views
What Are XMLType Views?
Creating XMLType Views: Syntax
Creating Non-Schema-Based XMLType Views
Using SQL/XML Generation Functions to Create Non-Schema-Based XMLType Views
Using Object Types with SYS_XMLGEN to Create Non-Schema-Based XMLType Views
Creating XML Schema-Based XMLType Views
Using SQL/XML Generation Functions to Create XML Schema-Based XMLType Views
Using Namespaces With SQL/XML Functions
Using Object Types and Views to Create XML Schema-Based XMLType Views
Creating Schema-Based XMLType Views Over Object Views
Wrapping Relational Department Data with Nested Employee Data as XML
Creating XMLType Views From XMLType Tables
Referencing XMLType View Objects Using REF()
DML (Data Manipulation Language) on XMLType Views
XPath Rewrite on XMLType Views
Views Constructed With SQL/XML Generation Functions
XPath Rewrite on Non-Schema-Based Views Constructed With SQL/XML
XPath Rewrite on Schema-Based Views Constructed With SQL/XML
Views Using Object Types, Object Views, and SYS_XMLGEN
Non-Schema-Based XMLType Views Using Object Types or Object Views
XML-Schema-Based Views Using Object Types or Object Views
XPath Rewrite Event Trace
Generating XML Schema-Based XML Without Creating Views
19
Accessing Data Through URIs
Overview of Oracle XML DB URL Features
URIs and URLs
URIType and its Subtypes
DBUris and XDBUris – What For?
URIType Methods
HTTPURIType Method getContentType()
DBURIType Method getContentType()
DBURIType Method getClob()
DBURIType Method getBlob()
Accessing Data Using URIType Instances
XDBUris: Pointers to Repository Resources
XDBUri URI Syntax
XDBUri Examples
DBUris: Pointers to Database Data
Viewing the Database as XML Data
DBUri URI Syntax
DBUris are Scoped to a Database and Session
DBUri Examples
Targeting a Table
Targeting a Row in a Table
Targeting a Column
Retrieving the Text Value of a Column
Targeting a Collection
Creating New Subtypes of URIType using Package URIFACTORY
Registering New URIType Subtypes with Package URIFACTORY
SYS_DBURIGEN SQL Function
Rules for Passing Columns or Object Attributes to SYS_DBURIGEN
SYS_DBURIGEN SQL Function: Examples
DBUriServlet
Customizing DBUriServlet
DBUriServlet Security
Configuring Package URIFACTORY to Handle DBUris
Part V Oracle XML DB Repository: Foldering, Security, and Protocols
20
Accessing Oracle XML DB Repository Data
Overview of Oracle XML DB Foldering
Repository Terminology and Supplied Resources
Repository Terminology
Supplied Files and Folders
Oracle XML DB Resources
Where Is Repository Data Stored?
Names of Generated Tables
Defining Structured Storage for Resources
ASM Virtual Folder
Path-Name Resolution
Resource Deletion
Accessing Oracle XML DB Repository Resources
Navigational or Path Access
Accessing Oracle XML DB Resources Using Internet Protocols
Where You Can Use Oracle XML DB Protocol Access
Using Protocol Access
Retrieving Oracle XML DB Resources
Storing Oracle XML DB Resources
Using Internet Protocols and XMLType: XMLType Direct Stream Write
Accessing ASM Files Using Protocols and Resource APIs – For DBAs
Query-Based Access
Accessing Repository Data Using Servlets
Accessing Data Stored in Repository Resources
Managing and Controlling Access to Resources
21
Managing Resource Versions
Overview of Oracle XML DB Versioning
Oracle XML DB Versioning Features
Oracle XML DB Versioning Terms Used in This Chapter
Oracle XML DB Resource ID and Path Name
Creating a Version-Controlled Resource (VCR)
Version Resource ID or VCR Version
Resource ID of a New Version
Accessing a Version-Controlled Resource (VCR)
Updating a Version-Controlled Resource (VCR)
DBMS_XDB_VERSION.CheckOut() Procedure
DBMS_XDB_VERSION.CheckIn() Procedure
DBMS_XDB_VERSION.UnCheckOut Procedure
Update Contents and Properties
Access Control and Security of VCR
Guidelines for Using Oracle XML DB Versioning
22
SQL Access Using RESOURCE_VIEW and PATH_VIEW
Overview of 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 SQL Function
EQUALS_PATH SQL Function
PATH SQL Function
DEPTH SQL Function
Using the RESOURCE_VIEW and PATH_VIEW APIs
Accessing Repository Data Paths, Resources and Links: Examples
Deleting Repository Resources: Examples
Deleting Nonempty Folder Resources
Updating Repository Resources: Examples
Working with Multiple Oracle XML DB Resources
Performance Tuning of Oracle XML DB Resource Queries
Searching for Resources Using Oracle Text
23
PL/SQL Access Using DBMS_XDB
Overview of PL/SQL Package DBMS_XDB
DBMS_XDB: Resource Management
DBMS_XDB: ACL-Based Security Management
DBMS_XDB: Configuration Management
24
Repository Resource Security
Overview of Oracle XML DB Resource Security and ACLs
How the ACL-Based Security Mechanism Works
Access Control List Concepts
Access Privileges
Atomic Privileges
Aggregate Privileges
Interaction with Database Table Security
Working with Oracle XML DB ACLs
Creating an ACL Using DBMS_XDB.createResource
Setting the ACL of a Resource
Deleting an ACL
Updating an ACL
Retrieving the ACL Document for a Given Resource
Retrieving Privileges Granted to the Current User for a Particular Resource
Checking if the Current User Has Privileges on a Resource
Checking if the Current User Has Privileges With the ACL and Resource Owner
Retrieving the Path of the ACL that Protects a Given Resource
Retrieving the Paths of All Resources Protected by a Given ACL
Integrating Oracle XML DB with LDAP
Performance Issues for Using ACLs
25
FTP, HTTP(S), and WebDAV Access to Repository Data
Overview of Oracle XML DB Protocol Server
Session Pooling
Oracle XML DB Protocol Server Configuration Management
Configuring Protocol Server Parameters
Configuring Secure HTTP (HTTPS)
Enable the HTTP Listener to Use SSL
Enable TCPS Dispatcher
Interaction with Oracle XML DB File-System Resources
Protocol Server Handles XML Schema-Based or Non-Schema-Based XML Documents
Event-Based Logging
Using FTP and Oracle XML DB Protocol Server
Oracle XML DB Protocol Server: FTP Features
FTP Features That Are Not Supported
FTP Client Methods That Are Supported
FTP Quote Methods
Using FTP with ASM Files
Using FTP on Standard or Nonstandard Ports
FTP Server Session Management
Handling Error 421. Modifying the Default Timeout Value of an FTP Session
FTP Client Failure in Passive Mode
Using HTTP(S) and Oracle XML DB Protocol Server
Oracle XML DB Protocol Server: HTTP(S) Features
HTTP(S) Features That Are Not Supported
HTTP(S) Client Methods That Are Supported
Using HTTP(S) on Nonstandard Ports
HTTPS: Support for Secure HTTP
Anonymous Access to Oracle XML DB Repository using HTTP
Using Java Servlets with HTTP(S)
Sending Multibyte Data From a Client
Characters That Are Not ASCII In URLs
Controlling Character Sets for HTTP(S)
Using WebDAV and Oracle XML DB
Oracle XML DB WebDAV Features
WebDAV Features That Are Not Supported
Supported WebDAV Client Methods
Using WebDAV with Microsoft Windows XP SP2
Using Oracle XML DB and WebDAV: Creating a WebFolder in Windows 2000
26
User-Defined Repository Metadata
Overview of Metadata and XML
Kinds of Metadata – Uses of the Term
User-Defined Resource Metadata
Scenario: Metadata for a Photo Collection
XML Schemas to Define Resource Metadata
Adding, Updating, and Deleting Resource Metadata
Using APPENDRESOURCEMETADATA to Add Metadata
Using DELETERESOURCEMETADATA to Delete Metadata
Using SQL DML to Add Metadata
Using WebDAV PROPPATCH to Add Metadata
Querying Schema-Based Resource Metadata
XML Image Metadata from Binary Image Metadata
Adding Non-Schema-Based Resource Metadata
PL/SQL Procedures Affecting Resource Metadata
27
Writing Oracle XML DB Applications in Java
Overview of Oracle XML DB Java Applications
Which Oracle XML DB APIs Are Available Inside and Outside the Database?
Design Guidelines: Java Inside or Outside the Database?
HTTP(S): Accessing Java Servlets or Directly Accessing XMLType Resources
Accessing Many XMLType Object Elements: Use JDBC XMLType 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 Oracle XML DB Servlets
Session Pool and Oracle XML DB Servlets
Native XML Stream Support
Oracle XML DB Servlet APIs
Oracle XML DB Servlet Example
Installing the Oracle XML DB Example Servlet
Configuring the Oracle XML DB Example Servlet
Testing the Example Servlet
Part VI Oracle Tools that Support Oracle XML DB
28
Administering Oracle XML DB
Installing and Reinstalling Oracle XML DB
Installing or Reinstalling Oracle XML DB From Scratch
Installing a New Oracle XML DB With Database Configuration Assistant
Dynamic Protocol Registration of FTP and HTTP(S) Services with Local Listener
Installing Oracle XML DB Manually Without DBCA
Postinstallation
Reinstalling Oracle XML DB
Upgrading an Existing Oracle XML DB Installation
Upgrading Oracle XML DB from Release 9.2 to Release 10
g
Privileges for Nested XMLType Tables When Upgrading to Oracle Database 10
g
Upgrading an Existing LCR XML Schema
Using Oracle Enterprise Manager to Administer Oracle XML DB
Configuring Oracle XML DB Using xdbconfig.xml
Oracle XML DB Configuration File, xdbconfig.xml
<xdbconfig> (Top-Level Element)
<sysconfig> (Child of <xdbconfig>)
<userconfig> (Child of <xdbconfig>)
<protocolconfig> (Child of <sysconfig>)
<httpconfig> (Child of <protocolconfig>)
<servlet> (Descendent of <httpconfig>)
Oracle XML DB Configuration File Example
Oracle XML DB Configuration API
Configuring Default Namespace to Schema Location Mappings
Configuring XML File Extensions
29
Loading XML Data Using SQL*Loader
Overview of Loading XMLType Data into Oracle Database
Using SQL*Loader 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 XML Columns Containing LOB Data from LOBFILEs
Specifying LOBFILEs
Using SQL*Loader to Load XMLType Data Directly From the Control File
Loading Very Large XML Documents into Oracle Database
30
Importing and Exporting XMLType Tables
Overview of IMPORT/EXPORT Support in Oracle XML DB
Non-Schema-Based XMLType Tables and Columns
XML Schema-Based XMLType Tables
Guidelines for Exporting Hierarchy-Enabled Tables
Using Transportable Tablespaces with Oracle XML DB
Resources and Foldering Do Not Fully Support IMPORT/EXPORT
Repository Metadata is Not Exported During a Full Database Export
Importing and Exporting with Different Character Sets
IMPORT/EXPORT Syntax and Examples
User Level Import/Export
Table Mode Export
31
Exchanging XML Data with Oracle Streams AQ
How Do AQ and XML Complement Each Other?
AQ and XML Message Payloads
AQ Enables Hub-and-Spoke Architecture for Application Integration
Messages Can Be Retained for Auditing, 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 PDFs 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 the XML Document Is Processed
Using HTTPS with AQ
Storing XML in Oracle Streams AQ Message Payloads
Comparing iDAP and SOAP
Part VII Appendixes
A
XML Schema Primer
XML Schema and Oracle XML DB
Namespaces
XML Schema and Namespaces
XML Schema Can Specify a targetNamespace Attribute
XML Instance Documents Declare Which XML Schema to Use in Their Root Element
schemaLocation Attribute
noNamespaceSchemaLocation Attribute
Declaring and Identifying XML Schema Namespaces
Registering an XML Schema
Oracle XML DB Creates a Default Table
Deriving an Object Model: Mapping the XML Schema Constructs to SQL Types
Oracle XML DB and DOM Fidelity
Annotating an XML Schema
Identifying and Processing Instance Documents
Overview of XML Schema
Purchase Order, po.xml
Association Between the Instance Document and the Purchase-Order XML Schema
Purchase-Order XML Schema, po.xsd
Prefix xsd:
XML Schema Components
Primary Components
Secondary Components
Helper Components
Complex Type Definitions, Element and Attribute Declarations
Defining the USAddress Type
Defining PurchaseOrderType
Occurrence Constraints: minOccurs and maxOccurs
Default 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 Definitions
Element Content
Complex Types from Simple Types
Mixed Content
Empty Content
AnyType
Annotations
Building Content Models
Attribute Groups
Adding Attributes to the Inline Type Definition
Adding Attributes Using an Attribute Group
Nil Values
How DTDs and XML Schema Differ
DTD Limitations
XML Schema Features Compared to DTD Features
Converting Existing DTDs to XML Schema?
XML Schema Example, purchaseOrder.xsd
B
XPath and Namespace Primer
Overview of the W3C XML Path Language (XPath) 1.0 Recommendation
XPath Models an XML Document as a Tree of Nodes
XPath Expression
Evaluating Expressions with Respect to a Context
Evaluating Subexpressions
XPath Expressions Often Occur in XML Attributes
Location Paths
Location Path Syntax Abbreviations
Location Path Examples Using Unabbreviated Syntax
Location Path Examples Using Abbreviated Syntax
Attribute Abbreviation @
Path Abbreviation //
Location Step Abbreviation .
Location Step Abbreviation ..
Abbreviation Summary
Relative and Absolute Location Paths
Location Path Syntax Summary
XPath 1.0 Data Model
Nodes
Root Nodes
Element Nodes
Text Nodes
Attribute Nodes
Namespace Nodes
Processing Instruction Nodes
Comment Nodes
Expanded-Name
Document Order
Overview of 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: Prefixes Beginning X-M-L
Qualified Names
Qualified Name Syntax
What is the Prefix?
Using Qualified Names
Element Types
Attribute
Namespace Constraint: Prefix Declared
Qualified Names in Declarations
Applying Namespaces to Elements and Attributes
Namespace Scoping
Namespace Defaulting
Uniqueness of Attributes
Conformance of XML Documents
Overview of the W3C XML Information Set
Namespaces and the W3C XML Information Set
Entities
End-of-Line Handling
Base URIs
Unknown and No Value
Synthetic Infosets
C
XSLT Primer
Overview of XSL
W3C XSL Transformation Recommendation Version 1.0
Namespaces in XML
XSL Style Sheet Architecture
XSL Transformation (XSLT)
XML Path Language (Xpath)
CSS Versus XSL
XSL Style Sheet Example, PurchaseOrder.xsl
D
Oracle-Supplied XML Schemas and Examples
XDBResource.xsd: XML Schema for Oracle XML DB Resources
XDBResource.xsd
acl.xsd: XML Schema for Oracle XML DB ACLs
ACL Representation XML Schema, acl.xsd
acl.xsd
xdbconfig.xsd: XML Schema for Configuring Oracle XML DB
xdbconfig.xsd
Purchase-Order XML Schemas
Loading XML Using C (OCI)
Initializing and Terminating an XML Context (OCI)
E
Oracle XML DB Restrictions
Index