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 next page
View PDF

Contents

Title and Copyright Information

Send Us Your Comments

Preface

Audience
Organization
Related Documentation
Conventions
Documentation Accessibility

What's New In Oracle XML DB?

Oracle XML DB: Oracle9i Release 2 (9.2.0.2): Enhancements
Oracle XML DB, Oracle9i Release 2 (9.2.0.1): XMLType Enhancements
Oracle XML DB, Oracle9i Release 2 (9.2.0.1): Repository
Oracle Tools Enhancements for Oracle XML DB
Oracle Text Enhancements
Oracle Advanced Queuing (AQ) Support
Oracle XDK Support for XMLType

Part I Introducing Oracle XML DB

1 Introducing Oracle XML DB

Introducing Oracle XML DB
Not a Separate Database Server
Benefits of Oracle XML DB
Key Features of Oracle XML DB
Oracle XML DB and XML Schema
Oracle XML DB Architecture
XMLType Tables and Views Storage
Oracle XML DB Repository
XMLType Storage Architecture
Cached XML Object Management Architecture
XML Repository Architecture
Why Use Oracle XML DB?
Unifying Data and Content with Oracle XML DB
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 Oracle XML DB XML Messaging Applications with Advanced Queueing
Managing Oracle XML DB Applications with Oracle Enterprise Manager
Requirements for Running Oracle XML DB
Standards Supported by Oracle XML DB
Oracle XML DB Technical Support
Terminology Used in This Manual
Oracle XML DB Examples Used in This Manual

2 Getting Started with Oracle XML DB

Getting Started with Oracle XML DB
Installing Oracle XML DB
When to Use the Oracle XML DB
Designing Your XML Application
Oracle XML DB Design Issues: Introduction
a. Data
b. Access
c. Application Language
d. Processing
Storage
Oracle XML DB Application Design: a. How Structured Is Your Data?
Oracle XML DB Application Design: b. Access Models
Oracle XML DB Application Design: c. Application Language
Oracle XML DB Application Design: d. Processing Models
Oracle XML DB Design: Storage Models
Using XMLType Tables
Using XMLType Views

3 Using Oracle XML DB

Storing Data in an XMLType Column or XMLType Table
Accessing Data in XMLType Columns or XMLType Tables
Using XPath with Oracle XML DB
Using existsNode()
Using extractValue()
Using extract()
Using XMLSequence()
Updating XML Documents with updateXML()
Introducing the W3C XSLT Recommendation
Using XSL/XSLT with Oracle XML DB
Other XMLType Methods
Introducing the W3C XML Schema Recommendation
Using XML Schema with Oracle XML DB
XMLSchema-Instance Namespace
Validating an XML Document Using an XML Schema
Storing XML: Structured or Unstructured Storage
Data Manipulation Language (DML) Independence
DOM Fidelity in Structured and Unstructured Storage
Structured Storage: XML Schema-Based Storage of XMLType
Structured Storage: Storing complexType Collections
Structured Storage: Data Integrity and Constraint Checking
Oracle XML DB Repository
Query-Based Access to Oracle XML DB Repository
Using RESOURCE_VIEW
Using PATH_VIEW
Creating New Folders and Documents
Querying Resource Documents
Updating Resources
Deleting Resources
Storage Options for Resources
Defining Your Own Default Table Storage for XML Schema-Based Documents
Accessing XML Schema-Based Content
Accessing Non-Schema-Based Content With XDBUriType
Oracle XML DB Protocol Servers
Using FTP Protocol Server
Using HTTP/WebDAV Protocol Server

Part II Storing and Retrieving XML Data in Oracle XML DB

4 Using XMLType

What Is XMLType?
Benefits of the XMLType Data Type and API
When to Use XMLType
Storing XMLType Data in Oracle XML DB
Pros and Cons of XML Storage Options in Oracle XML DB
When to Use CLOB Storage for XMLType
XMLType Member Functions
How to Use the XMLType API
Creating, Adding, and Dropping XMLType Columns
Inserting Values into an XMLType Column
Using XMLType in an SQL Statement
Updating an XMLType Column
Deleting a Row Containing an XMLType Column
Guidelines for Using XMLType Tables and Columns
Specifying Storage Characteristics on XMLType Columns
Changing Storage Options on an XMLType Column Using XMLData
Specifying Constraints on XMLType Columns
Manipulating XML Data in XMLType Columns/Tables
Inserting XML Data into XMLType Columns/Tables
Using INSERT Statements
Selecting and Querying XML Data
Selecting XML Data
Querying XML Data
Using XPath Expressions for Searching XML Documents
Querying XML Data Using XMLType Member Functions
existsNode Function
extract () Function
extractValue() Function
More SQL Examples That Query XML
Updating XML Instances and Data in Tables and Columns
updateXML() SQL Function
Creating Views of XML Data with updateXML()
Optimization of updateXML()
updateXML() and NULL Values
Updating the Same XML Node More Than Once
XMLTransform() Function
Deleting XML Data
Using XMLType In Triggers
Indexing XMLType Columns
Creating Function-Based Indexes on XMLType Columns
Creating Oracle Text Indexes on XMLType Columns

5 Structured Mapping of XMLType

Introducing XML Schema
XML Schema and Oracle XML DB
Using Oracle XML DB and XML Schema
Why Do We Need XML Schema?
DTD Support in Oracle XML DB
Introducing DBMS_XMLSCHEMA
Registering Your XML Schema Before Using Oracle XML DB
Registering Your XML Schema Using DBMS_XMLSCHEMA
Local and Global XML Schemas
Registering Your XML Schema: Oracle XML DB Sets Up the Storage and Access Infrastructure
Deleting Your XML Schema Using DBMS_XMLSCHEMA
Guidelines for Using Registered XML Schemas
Objects That Depend on Registered XML Schemas
Creating XMLType Tables, Views, or Columns
Validating XML Instances Against the XML Schema: schemaValidate()
Fully Qualified XML Schema URLs
Transactional Behavior of XML Schema Registration
Generating XML Schema Using DBMS_XMLSCHEMA.generateSchema()
XML Schema-Related Methods of XMLType
Managing and Storing XML Schema
Root XML Schema, XDBSchema.xsd
How Are XML Schema-Based XMLType Structures Stored?
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
SQL Object-Relational Types Store XML Schema-Based XMLType Tables
Specifying SQL Object Type Names with SQLName, SQLType Attributes
SQL Mapping Is Specified in the XML Schema During Registration
Mapping of Types Using DBMS_XMLSCHEMA
Setting Attribute Mapping Type Information
Setting Element Mapping Type Information
XML Schema: Mapping SimpleTypes to SQL
simpleType: Mapping XML Strings to SQL VARCHAR2 Versus CLOBs
XML Schema: Mapping complexTypes to SQL
Setting the SQLInLine Attribute to FALSE for Out-of-Line Storage
Mapping XML Fragments to Large Objects (LOBs)
Oracle XML DB complexType Extensions and Restrictions
complexType Declarations in XML Schema: Handling Inheritance
Mapping complexType: simpleContent to Object Types
Mapping complexType: Any and AnyAttributes
Handling Cycling Between complexTypes in XML Schema
Further Guidelines for Creating XML Schema-Based XML Tables
Specifying Storage Clauses in XMLType CREATE TABLE Statements
Inserting New Instances into XMLType Columns
Query Rewrite with XML Schema-Based Structured Storage
What Is Query Rewrite?
When Does Query Rewrite Occur?
What XPath Expressions Are Rewritten?
How are the XPaths Rewritten?
Rewriting XPath Expressions: Mapping Types and Issues
XPath Expression Rewrites for existsNode()
Rewrite for extractValue()
Rewrite for extract()
Optimizing Updates Using updateXML()
Creating Default Tables During XML Schema Registration
Ordered Collections in Tables (OCTs)
Using OCT for VARRAY Storage
Cyclical References Between XML Schemas
Frequently Asked Questions (FAQs): XML DB, XML Schema-Based Issues
Why Do I Appear to get Memory Leaks When Using Bind Variables for XPath
Expressions?
How Do I Check that Query Rewrite is Working Correctly?
Why Does the XML DB Query Not Use My Index?
How Do I Specify Attributes in a complexType XML Schema Declaration?
Why Do the XML Schema and Element Not Match?
How Do I Pull a Stylesheet From RESOURCE_VIEW [S/MIME]?
Why for Our XML Parser Does selectSingleNode return NULL When the xmlns
Attribute is Added?
Why Do I Get Error ORA-19007: Schema and Element Do Not Match?
Is it Possible to Register XML Schema for Schemas?

6 Transforming and Validating XMLType Data

Transforming XMLType Instances
XMLTransform() and XMLType.transform()
XMLTransform() Examples
Validating XMLType Instances
Validating XML Data Stored as XMLType: Examples

7 Searching XML Data with Oracle Text

Searching XML Data with Oracle Text
Introducing Oracle Text
Assumptions Made in This Chapter's Examples
Oracle Text Users and Roles
Querying with the CONTAINS Operator
Using the WITHIN Operator to Narrow Query Down to Document Sections
Introducing SECTION_GROUPS
XML_SECTION_GROUP
AUTO_ SECTION_GROUP/ PATH_SECTION_GROUP for INPATH and HASPATH
Dynamically Adding Sections or Stop Section Using ALTER INDEX
WITHIN Syntax for Section Querying
WITHIN Operator Limitations
INPATH or HASPATH Operators Search Using XPath-Like Expressions
Using INPATH Operator for Path Searching in XML Documents
Using HASPATH Operator for Path Searching in XML Documents
Building a Query Application with Oracle Text
What Role Do You Need?
Step 1. Create a Section Group Preference
Deciding Which Section Group to Use
Creating a Section Preference with XML_SECTION_GROUP
Creating a Section Preference with AUTO_SECTION_GROUP
Creating a Section Preference with PATH_SECTION_GROUP
Step 2. Set the Preference's Attributes
2.1 XML_SECTION_GROUP: Using CTX_DDL.add_zone_section
2.2 XML_SECTION_GROUP: Using CTX_DDL.Add_Attr_Section
2.3 XML_SECTION_GROUP: Using CTX_DDL.Add_Field_Section
2.5 AUTO_SECTION_GROUP: Using CtX_DDL.Add_Stop_Section
Step 3. Create an Index Using the Section Preference Created in Step 2
Step 4. Create Your Query Syntax
Querying Within Attribute Sections
Presenting the Results of Your Query
XMLType Indexing
You Need Query Rewrite Privileges
System Parameter is Set to the Default, CTXSYS.PATH_SECTION_GROUP
XMLType Indexes Work Like Other Oracle Text Indexes
Using Oracle Text with Oracle XML DB
Creating an Oracle Text Index on an UriType Column
Querying XML Data: Use CONTAINS or existsNode()?
Full-Text Search Functions in XPath Using ora:contains
ora:contains Features
ora:contains Syntax
ora:contains Examples
Oracle XML DB: Creating a Policy for ora:contains()
Oracle XML DB: Using CTXXPATH Indexes for existsNode()
Why do We Need CTXXPATH When ConText Indexes Can Perform XPath Searches?
CTXXPATH Index Type
Creating CTXXPATH Indexes
Creating CTXXPATH Storage Preferences with CTX_DDL. Statements
Performance Tuning CTXXPATH Index: Synchronizing and Optimizing the Index
Using Oracle Text: Advanced Techniques
Highlight Support for INPATH/HASPATH Text Operators
Distinguishing Tags Across DocTypes
Specifying Doctype Limiters to Distinguish Between Tags
Doctype-Limited and Unlimited Tags in a Section Group
XML_SECTION_GROUP Attribute Sections
Constraints for Querying Attribute Sections
Repeated Zone Sections
Overlapping Zone Sections
Nested Sections
Using Table CTX_OBJECTS and CTX_OBJECT_ATTRIBUTES View
Case Study: Searching XML-Based Conference Proceedings
Searching for Content and Structure in XML Documents
Searching XML-Based Conference Proceedings Using Oracle Text
Searching Conference Proceedings Example: jsp
Frequently Asked Questions About Oracle Text
FAQs: General Questions About Oracle Text
FAQs: Searching Attribute Values with Oracle Text
FAQs: Searching XML Documents in CLOBs Using Oracle Text

Part III Using XMLType APIs to Manipulate XML Data

8 PL/SQL API for XMLType

Introducing PL/SQL APIs for XMLType
Backward Compatibility with XDK for PL/SQL, Oracle9i Release 1 (9.0.1)
PL/SQL APIs For XMLType Features
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
PL/SQL DOM API for XMLType (DBMS_XMLDOM): Features
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
Wrapping Existing Data into XML with XMLType Views
PL/SQL DOM API for XMLType (DBMS_XMLDOM) Methods
PL/SQL DOM API for XMLType (DBMS_XMLDOM) Exceptions
PL/SQL DOM API for XMLType: Node Types
Working with XML Schema-Based XML Instances
DOM NodeList and NamesNodeMap Objects
PL/SQL DOM API for XMLType (DBMS_XMLDOM): Calling Sequence
PL/SQL DOM API for XMLType Examples
PL/SQL Parser API for XMLType (DBMS_XMLPARSER)
PL/SQL Parser API for XMLType: Features
PL/SQL Parser API for XMLType (DBMS_XMLPARSER): Calling Sequence
PL/SQL Parser API for XMLType Example
PL/SQL XSLT Processor for XMLType (DBMS_XSLPROCESSOR)
Enabling Transformations and Conversions with XSLT
PL/SQL XSLT Processor for XMLType: Features
PL/SQL XSLT Processor API (DBMS_XSLPROCESSOR): Methods
PL/SQL Parser API for XMLType (DBMS_XSLPROCESSOR): Calling Sequence
PL/SQL XSLT Processor for XMLType Example

9 Java API for XMLType

Introducing Java DOM API for XMLType
Java DOM API for XMLType
Accessing XML Documents Stored in Oracle9i Database (Java)
Using JDBC to Manipulate XML Documents Stored in a Database
Java DOM API for XMLType Features
Java DOM API for XMLType Classes
Non-Supported Java Methods
Java DOM API for XMLType: Calling Sequence

Part IV Viewing Existing Data as XML

10 Generating XML Data from the Database

Oracle XML DB Options for Generating XML Data From Oracle9i Database
Generating XML Using SQLX Functions
Generating XML Using Oracle Extensions to SQLX
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 SQLX Functions
XMLElement() Function
XMLForest() Function
XMLSEQUENCE() Function
XMLConcat() Function
XMLAgg() Function
Generating XML from the Database Using SQLX Functions
XMLColAttVal() Function
Generating XML from Oracle9i Database Using DBMS_XMLGEN
Sample DBMS_XMLGEN Query Result
DBMS_XMLGEN Calling Sequence
Generating XML Using Oracle-Provided SQL Functions
SYS_XMLGEN() Function
Using XMLFormat Object Type
SYS_XMLAGG() Function
Generating XML Using XSQL Pages Publishing Framework
Generating XML Using XML SQL Utility (XSU)

11 XMLType Views

What Are XMLType Views?
Creating Non-Schema-Based XMLType Views
Creating XML Schema-Based XMLType Views
Creating XML Schema-Based XMLType Views Using SQL/XML Generation
Functions
Creating XMLType Views Using Object Types and Views
Creating XMLType Views From XMLType Tables
Referencing XMLType View Objects Using REF()
DML (Data Manipulation Language) on XMLType Views
Query Rewrite on XMLType Views
Query Rewrite on XML Schema-Based Views
Query Rewrite on Non-Schema-Based XMLType Views
Ad-Hoc Generation of XML Schema-Based XML
Validating User-Specified Information

12 Creating and Accessing Data Through URLs

How Oracle9i Database Works with URLs and URIs
URI Concepts
What Is a URI?
Advantages of Using DBUri and XDBUri
UriTypes Store Uri-References
Advantages of Using UriTypes
UriType Functions
HttpUriType Functions
getContentType() Function
getXML() Function
DBUri, Intra-Database References
Formulating the DBUri
Notation for DBUriType Fragments
DBUri Syntax Guidelines
Some Common DBUri Scenarios
Identifying the Whole 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
Creating Oracle Text Indexes on UriType Columns
Using UriType Objects
Storing Pointers to Documents with UriType
Using HttpUriType and DBUriType
Creating Instances of UriType Objects with the UriFactory Package
Registering New UriType Subtypes with the UriFactory Package
Why Define New Subtypes of UriType?
SYS_DBURIGEN() SQL Function
Rules for Passing Columns or Object Attributes to SYS_DBURIGEN()
SYS_DBURIGEN Examples
Turning a URL into a Database Query with DBUri Servlet
DBUri Servlet Mechanism
Installing DBUri Servlet
DBUri Security
Configuring the UriFactory Package to Handle DBUris

Part V Oracle XML DB Repository: Foldering, Security, and Protocols

13 Oracle XML DB Foldering

Introducing Oracle XML DB Foldering
Oracle XML DB Repository
Repository Terminology
Oracle XML DB Resources
Where Exactly Is Repository Data Stored?
Pathname Resolution
Deleting Resources
Accessing Oracle XML DB Repository Resources
Navigational or Path Access
Accessing Oracle XML DB Resources Using Internet Protocols
Query-Based Access
Accessing Repository Data Using Servlets
Accessing Data Stored in Oracle XML DB Repository Resources
Managing and Controlling Access to Resources
Extending Resource Metadata Properties
Frequently Asked Questions (FAQs): XML DB Repository
Why Does XML Repository Hierarchical Index Not Work?

14 Oracle XML DB Versioning

Introducing 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 or VCR Version
Resource ID of a New Version
Accessing a Version-Controlled Resource (VCR)
Updating a Version-Controlled Resource (VCR)
Access Control and Security of VCR
Frequently Asked Questions: Oracle XML DB Versioning
Can I Switch a VCR to a Non-VCR?
How Do I Access the Old Copy of a VCR After Updating It?
Can We Use Version Control for Data Other Than Oracle XML DB Data?

15 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, Path_View API
UNDER_PATH
EQUALS_PATH
PATH
DEPTH
Using the Resource View and Path View API
Accessing Paths and Repository Resources: Examples
Inserting Data into a Repository Resource: Examples
Deleting Repository Resources: Examples
Updating Repository Resources: Examples
Working with Multiple Oracle XML DB Resources Simultaneously
Tuning XML DB to Obtain Faster Queries
Searching for Resources Using Oracle Text

16 Oracle XML DB Resource API for PL/SQL (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: Oracle XML DB Configuration Management
Using DBMS_XDB for Configuration Management, Calling Sequence
DBMS_XDB: Rebuilding Oracle XML DB Hierarchical Indexes
Using DBMS_XDB to Rebuild Hierarchical Indexes, Calling Sequence

17 Oracle XML DB Resource API for Java

Introducing Oracle XML DB Resource API for Java
Using Oracle XML DB Resource API for Java
Parameters for Oracle XML DB Resource API for Java
Oracle XML DB Resource API for Java: Examples

18 Oracle XML DB Resource Security

Introducing Oracle XML DB Resource Security and ACLs
How the ACL-Based Security Mechanism Works
Access Control List Terminology
Oracle XML DB ACL Features
ACL Interaction with Oracle XML DB Table/View Security
LDAP Integration and User IDs
Oracle XML DB Resource API for ACLs (PL/SQL)
How Concurrency Issues Are Resolved with Oracle XML DB ACLs
Access Control: User and Group Access
ACE Elements Specify Access Privileges for Principals
Oracle XML DB Supported Privileges
Atomic Privileges
Aggregate Privileges
ACL Evaluation Rules
Using Oracle XML DB ACLs
Updating the Default ACL on a Folder
ACL and Resource Management
How to Set Resource Property ACLs
Default Assignment of ACLs
Retrieving ACLs for a Resource
Changing Privileges on a Given Resource
Restrictions for Operations on ACLs
Using DBMS_XDB to Check Privileges
Row-Level Security for Access Control Security

19 Using FTP, HTTP, and WebDAV Protocols

Introducing Oracle XML DB Protocol Server
Session Pooling
Oracle XML DB Protocol Server Configuration Management
Configuring Protocol Server Parameters
Interaction with Oracle XML DB Filesystem 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
Using HTTP and Oracle XML DB Protocol Server
Oracle XML DB Protocol Server: HTTP Features
Using WebDAV and Oracle XML DB
Oracle XML DB WebDav Features
Using Oracle XML DB and WebDAV: Creating a WebFolder in Windows 2000

20 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 Guidelines: Java Inside or Outside the Database?
HTTP: 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
The Session Pool and 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

21 Managing Oracle XML DB Using Oracle Enterprise Manager

Introducing Oracle XML DB and Oracle Enterprise Manager
Getting Started with Oracle Enterprise Manager and 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 Enterprise 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
Creating and Managing Oracle XML DB Resources with Enterprise Manager
Administering Individual Resources
Individual Resource Content Menu
Enterprise Manager and Oracle XML DB: ACL Security
Granting and Revoking User Privileges with User > XML Tab
XML Database Resource Privileges
Managing XML Schema and Related Database Objects
Navigating XML Schema in Enterprise Manager
Registering an XML Schema
Creating Structured Storage Infrastructure Based on XML Schema
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

22 Loading XML Data into Oracle XML DB

Loading XMLType Data into Oracle9i Database
Restoration
Using SQL*Loader to Load XMLType Columns

23 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 XMLType 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 Not Exported During a Full Database Export
Importing and Exporting with Different Character Sets

Part VII XML Data Exchange Using Advanced Queueing

24 Exchanging XML Data Using Advanced Queueing (AQ) and Oracle Streams

What Is AQ?
How Do AQ and XML Complement Each Other?
Oracle Streams and AQ
Streams Message Queuing
XMLType Attributes in Object Types
Internet Data Access Presentation (IDAP)
IDAP Architecture
XMLType Queue Payloads
Enqueue Using AQ XML Servlet
Dequeue Using AQ XML Servlet
IDAP and AQ XML Schemas
Frequently Asked Questions (FAQs): XML and Advanced Queuing
Can I Store AQ XML Messages with Many PDFs as One Record?
Do I Specify Payload Type as CLOB First, Then Enqueue and Store?
Can I Add New Recipients After Messages Are Enqueued?
How Does Oracle Enqueue and Dequeue and Process XML Messages?
How Can I Parse Messages with XML Content from AQ Queues?
Can I Prevent the Listener from Stopping Until the XML Document Is Processed?
How Can I Use HTTPS with AQ?
What Are the Options for Storing XML in AQ Message Payloads?
Can We Compare IDAP and SOAP?

Part VIII Oracle XML DB Case Studies

25 Oracle XML DB Case Study: Web Services Retrieve and Display XML Documents

XML DB Web Services Case Study: Overview
What Happens When You Enter a PO Number?
Oracle XML Db Web Services: Main Components
Running XML DB Web Services Case Study: Implementation Steps
Before You Run this Case Study Demo
Steps for Implementing the XML DB Web Services Case Study
1. Run XDBServices.java
2. Implement GetPOXMLServlet.java
3. Deploy XDBServices Class to the Oracle9iAS/Web Services (SOAP) Server
4. Deploy displayPOXML.html to Display Results on Client-Side Web Server
5. Enter a PO Number and See the Retrieved PO Displayed
XML DB Web Services: Calling Sequence
XDBServices.java
getPOXMLServlet.java

26 Oracle XML DB Basic Demo

Prerequisites for Running the XML DB Basic Demo
Database SQL*NET and XML DB Configuration
Verify SQL*NET and XML DB Configuration
Installing XML DB Basic Demo
Editing installParameters.xml
Running the Installation Script
What is Oracle XML DB?
Oracle XML DB Components
Starting the XML DB Basic Demo
0.1 XML DB Demo: Initial Setup (Run Once)
0.2 XML DB Demo: Resetting the Demo
1.0 XML DB Demo: XML DB on localhost - WebDAV and FTP Support
1.1 Using SQL to Make Directories
1.2 Using FTP to Load Configuration Files
2.0 XML DB Demo: XML Schema - How XML DB Shreds and Stores XML
2.1 Registering XML Schema
2.2 Objects Are Created With XML Schema Registration
3.0 XML DB Demo: How XML Files Conform to the XML Schema
3.1 Using FTP to Load Instance Documents
3.2 Using SQL to Add Constraints to XML Data
3.3 Using FTP to Upload XML Documents that Attempt to Violate the Constraints
4.0 XML DB Demo: Simple XPath Queries Against XML Documents
4.1 More Complex XPath Queries on XML Documents
4.2 EXPLAIN Plan of Queries on XML Tables
4.3 Using extractValue() and an XPath Expression to Create XML Indexes
4.4 Using EXPLAIN Plan to Determine if the Index is Being Used
5.0 XML DB Demo: Using HTTP to Access XML Content
5.1 SQL Can Display the Retrieved XML Document Through XDBUriServlet
5.2 Editing XML Documents with WebDAV-Enabled Tools
5.3 Displaying and Verifying Updates Made to XML Documents, Using SQL
5.4 Updating XML Documents Using SQL
5.5 Displaying Changes Made to an XML Document Using Both XML and SQL
6.0 XML DB Demo: Querying RESOURCE_VIEWS Using SQL
6.1 XPath-Based Querying of RESOURCE_VIEWS Using Hierarchical Indexing
7.0 XML DB Demo: Using Views to Access XML from Relational Tools
7.1 Relational Views of XML Act Like Other Views
7.2 Querying Using Rollup
8.0 XML DB Demo: Accessing Content Using DBUriServlet; Transforming Content
Using XSL
8.1 PurchaseOrder Raw XML
8.2 Using Standard XSL Style Sheets to Transform XML Documents to HTML
8.3 Transforming PurchaseOrder Using XSLT
8.4 Creating XMLType Views with SQL
8.5 Displaying DEPTVIEW Raw XML Using DBUriServlet
8.6 Transforming DEPTVIEW From XML to HTML Using a Style Sheet
8.7 Displaying the Transformed DEPTVIEW After XSL Transformation
9.0 XML DB Demo: OracleText Examples

A Installing and Configuring Oracle XML DB

Installing Oracle XML DB
Installing or Reinstalling Oracle XML DB from Scratch
Installing a New Oracle XML DB with DBCA
Dynamic Protocol Registration Registers FTP and HTTP Services with Local Listener
Installing a New Oracle XML DB Manually Without DBCA
Reinstalling Oracle XML DB
Upgrading an Existing Oracle XML DB Installation
Upgrading XML DB From Release 2 (9.2.0.1) to Release 2 (9.2.0.2)
Migrating Data From Release 2 (9.2.0.1) to Release 2 (9.2.0.2)
Configuring Oracle XML DB
Oracle XML DB Configuration File, xdbconfig.xml
Top Level Tag <xdbconfig>
<sysconfig>
<userconfig>
<protocolconfig>
<httpconfig>
Oracle XML DB Configuration Example
Oracle XML DB Configuration API
Get Configuration, cfg_get()
Update Configuration, cfg_update()
Refresh Configuration, cfg_refresh()

B XML Schema Primer

Introducing XML Schema
Purchase Order Schema, po.xsd
XML Schema Components
Complex Type Definitions, Element and Attribute Declarations
Naming Conflicts
Simple Types
List Types
Union Types
Anonymous Type Definitions
Element Content
Complex Types from Simple Types
Mixed Content
Empty Content
AnyType
Annotations
Building Content Models
Attribute Groups
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

C XPath and Namespace Primer

Introducing the W3C XML Path Language (XPath) 1.0 Recommendation
The XPath Expression
Evaluating Expressions with Respect to a Context
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
Relative and Absolute Location Paths
Location Path Syntax Summary
XPath 1.0 Data Model
Nodes
Introducing the W3C XML Path Language (XPath) 2.0 Working Draft
XPath 2.0 Expressions
Introducing the W3C Namespaces in XML Recommendation
What Is a Namespace?
Qualified Names
Using Qualified Names
Namespace Constraint: Prefix Declared
Applying Namespaces to Elements and Attributes
Namespace Scoping
Namespace Defaulting
Uniqueness of Attributes
Conformance of XML Documents
Introducing the W3C XML Information Set
Namespaces
End-of-Line Handling
Base URIs
Unknown and No Value
Synthetic Infosets

D XSLT Primer

Introducing XSL
The W3C XSL Transformation Recommendation Version 1.0
Namespaces in XML
XSL Stylesheet Architecture
XSL Transformation (XSLT)
XML Path Language (Xpath)
CSS Versus XSL
XSL Stylesheet Example, PurchaseOrder.xsl

E Java DOM API for XMLType, Resource API for Java: Quick Reference

Java DOM API For XMLType
Non-Supported Java Methods
Oracle XML DB Resource API for Java

F Oracle XML DB XMLType API, PL/SQL and Resource 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)
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

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

Example Setup Scripts
Chapter 3 Examples Set Up Script: Creating User and Directory
Chapter 3 Examples Set Up Script: Granting Privileges, Creating Table...
Chapter 3 Examples Script: invoice.xml
Chapter 3 Examples Script: PurchaseOrder.xml
Chapter 3 Examples Script: FTP Script
Chapter 3 Examples Script: Configuring FTP and HTTP Ports
RESOURCE_VIEW and PATH_VIEW Database and XML Schema
Resource View Definition and Structure
PATH_VIW Definition and Structure
XDBResource.xsd: XML Schema for Representing Oracle XML DB Resources
XDBResource.xsd
acl.xsd: XML Schema for Representing Oracle XML DB ACLs
ACL Representation XML Schema, acl.xsd
acl.xsd
xdbconfig.xsd: XML Schema for Configuring Oracle XML DB
xdbconfig.xsd

Glossary

Index