Go to main content
1/47
Contents
List of Examples
List of Figures
List of Tables
Title and Copyright Information
Preface
Audience
Documentation Accessibility
Related Documents
Conventions
What's New in the XDK?
Features Introduced in Oracle XML Developer's Kit 11
g
Release 1 (11.1)
Features Introduced in Oracle XDK 11
g
Release 2 (11.2)
Features Changed in Oracle XDK 11
g
Release 2 (11.2)
1
Introduction to Oracle XML Developer's Kit
Overview of Oracle XML Developer's Kit (XDK)
XDK Components
XML Parsers
XSLT Processors
XML Schema Processors
XML Class Generators
XML Pipeline Processor
XDK JavaBeans
Oracle XML SQL Utility (XSU)
Handling or Representing an XML Document
Using XSU with an XML Class Generator
TransX Utility
XSQL Pages Publishing Framework
Soap Services
XSLT Virtual Machine (XVM)
XML Document Generation with the XDK Components
XML Document Generation with Java
XML Document Generation with C
XML Document Generation with C++
Development Tools and Frameworks for the XDK
Oracle JDeveloper
User Interface XML (UIX)
Oracle Reports
Oracle XML Gateway
Oracle Data Provider for .NET
Installing the XDK
Part I XDK for Java
2
Unified Java API for XML
Overview of Unified Java API
Component Unification
Moving to the Unified Java API Model
Java DOM APIs for XMLType Classes
Extension APIs
Document Creation Java APIs
3
Getting Started with Java XDK Components
Installing Java XDK Components
Java XDK Component Dependencies
Setting Up the Java XDK Environment
Setting Java XDK Environment Variables for UNIX
Testing the Java XDK Environment on UNIX
Setting Java XDK Environment Variables for Windows
Testing the Java XDK Environment on Windows
Verifying the Java XDK Components Version
4
XML Parsing for Java
Introduction to the XML Parsing for Java
Prerequisites
Standards and Specifications
Large Node Handling
XML Parsing in Java
DOM in XML Parsing
DOM Creation
Scalable DOM
Pluggable DOM Support
Lazy Materialization
Configurable DOM Settings
SAX in the XML Parser
JAXP in the XML Parser
Namespace Support in the XML Parser
Validation in the XML Parser
Compression in the XML Parser
Using XML Parsing for Java: Overview
Using the XML Parser for Java: Basic Process
Running the XML Parser Demo Programs
Using the XML Parser Command-Line Utility
Parsing XML with DOM
Using the DOM API
DOM Parser Architecture
Performing Basic DOM Parsing
Useful Methods and Interfaces
Creating Scalable DOM
Using Pluggable DOM
Using Lazy Materialization
Using Configurable DOM Settings
Performance Advantages to Configurable DOM Settings
Scalable DOM Applications
Performing DOM Operations with Namespaces
Performing DOM Operations with Events
Performing DOM Operations with Ranges
Performing DOM Operations with TreeWalker
Parsing XML with SAX
Using the SAX API
Performing Basic SAX Parsing
Performing Basic SAX Parsing with Namespaces
Performing SAX Parsing with XMLTokenizer
Parsing XML with JAXP
Using the JAXP API
Using the SAX API Through JAXP
Using the DOM API Through JAXP
Transforming XML Through JAXP
Parsing with JAXP
Performing Basic Transformations with JAXP
Compressing XML
Compressing and Decompressing XML from DOM
Compressing a DOM Object
Decompressing a DOM Object
Compressing and Decompressing XML from SAX
Compressing a SAX Object
Decompressing a SAX Object
Tips and Techniques for Parsing XML
Extracting Node Values from a DOM Tree
Merging Documents with appendChild()
Parsing DTDs
Loading External DTDs
Caching DTDs with setDoctype
Handling Character Sets with the XML Parser
Detecting the Encoding of an XML File on the Operating System
Detecting the Encoding of XML Stored in an NCLOB Column
Writing an XML File in a Nondefault Encoding
Working with XML in Strings
Parsing XML Documents with Accented Characters
Handling Special Characters in Tag Names
5
Using Binary XML for Java
Introduction to Binary XML for Java
Binary XML Storage Format
Binary XML Processors
Models for Using Binary XML
Glossary for Binary XML
Standalone Model
Client-Server Model
Web Services Model with Repository
Web Services Model Without Repository
The Parts of Binary XML for Java
Binary XML Encoding
Binary XML Decoding
Binary XML Vocabulary Management
Schema Management
Schema Registration
Schema Identification
Schema Annotations
User-Level Annotations
System-Level Annotations
Token Management
Using Java Binary XML Package
Binary XML Encoder
Schema-less Option
Inline-token Option
Binary XML Decoder
Schema Registration
Resolving xsi:schemaLocation
Binary XML DB
Persistent Storage of Metadata
6
Using the XSLT Processor for Java
Introduction to the XSLT Processor
Prerequisites
Standards and Specifications
XML Transformation with XSLT 1.0 and 2.0
Using the XSLT Processor for Java: Overview
Using the XSLT Processor: Basic Process
Running the XSLT Processor Demo Programs
Using the XSLT Processor Command-Line Utility
Using the XSLT Processor Command-Line Utility: Example
Transforming XML
Performing Basic XSL Transformation
Obtaining DOM Results from an XSL Transformation
Programming with Oracle XSLT Extensions
Overview of Oracle XSLT Extensions
Specifying Namespaces for XSLT Extension Functions
Using Static and Non-Static Java Methods in XSLT
Using Constructor Extension Functions
Using Return Value Extension Functions
Tips and Techniques for Transforming XML
Merging XML Documents with XSLT
Creating an HTML Input Form Based on the Columns in a Table
7
Using the Schema Processor for Java
Introduction to XML Validation
Prerequisites
Standards and Specifications
XML Validation with DTDs
DTD Samples in the XDK
XML Validation with XML Schemas
XML Schema Samples in the XDK
Differences Between XML Schemas and DTDs
Using the XML Schema Processor: Overview
Using the XML Schema Processor: Basic Process
Running the XML Schema Processor Demo Programs
Using the XML Schema Processor Command-Line Utility
Using oraxml to Validate Against a Schema
Using oraxml to Validate Against a DTD
Validating XML with XML Schemas
Validating Against Internally Referenced XML Schemas
Validating Against Externally Referenced XML Schemas
Validating a Subsection of an XML Document
Validating XML from a SAX Stream
Validating XML from a DOM
Validating XML from Designed Types and Elements
Validating XML with the XSDValidator Bean
Tips and Techniques for Programming with XML Schemas
Overriding the Schema Location with an Entity Resolver
Converting DTDs to XML Schemas
8
Using the JAXB Class Generator
Introduction to the JAXB Class Generator
Prerequisites
Standards and Specifications
JAXB Class Generator Features
Marshalling and Unmarshalling with JAXB
Validation with JAXB
JAXB Customization
Using the JAXB Class Generator: Overview
Using the JAXB Processor: Basic Process
Running the XML Schema Processor Demo Programs
Using the JAXB Class Generator Command-Line Utility
Using the JAXB Class Generator Command-Line Utility: Example
JAXB Features Not Supported in the XDK
Processing XML with the JAXB Class Generator
Binding Complex Types
Defining the Schema
Generating and Compiling the Java Classes
Processing the XML Data
Customizing a Class Name in a Top-Level Element
Defining the Schema
Generating and Compiling the Java Classes
Processing the XML Data
9
Using the XML Pipeline Processor for Java
Introduction to the XML Pipeline Processor
Prerequisites
Standards and Specifications
Multistage XML Processing
Customized Pipeline Processes
Using the XML Pipeline Processor: Overview
Using the XML Pipeline Processor: Basic Process
Running the XML Pipeline Processor Demo Programs
Using the XML Pipeline Processor Command-Line Utility
Processing XML in a Pipeline
Creating a Pipeline Document
Example of a Pipeline Document
Writing a Pipeline Processor Application
Writing a Pipeline Error Handler
10
Using XDK JavaBeans
Introduction to XDK JavaBeans
Prerequisites
Standards and Specifications
XDK JavaBeans Features
DOMBuilder
XSLTransformer
DBAccess
XMLDBAccess
XMLDiff
XMLCompress
XSDValidator
Using the XDK JavaBeans: Overview
Using the XDK JavaBeans: Basic Process
Using the DOMBuilder JavaBean: Basic Process
Using the XSLTransformer JavaBean: Basic Process
Using the XMLDBAccess JavaBean: Basic Process
Using the XMLDiff JavaBean: Basic Process
Running the JavaBean Demo Programs
Running sample1
Running sample2
Running sample3
Running sample4
Running sample5
Running sample6
Running sample7
Running sample8
Running sample9
Running sample10
Processing XML with the XDK JavaBeans
Processing XML Asynchronously with the DOMBuilder and XSLTransformer Beans
Parsing the Input XSLT Stylesheet
Processing the XML Documents Asynchronously
Comparing XML Documents with the XMLDiff Bean
Comparing the XML Files and Generating a Stylesheet
11
Using the XML SQL Utility (XSU)
Introduction to the XML SQL Utility (XSU)
Prerequisites
XSU Features
XSU Restrictions
Using the XML SQL Utility: Overview
Using XSU: Basic Process
Generating XML with the XSU Java API: Basic Process
Performing DML with the XSU Java API: Basic Process
Generating XML with the XSU PL/SQL API: Basic Process
Performing DML with the PL/SQL API: Basic Process
Installing XSU
Installing XSU in the Database
Installing XSU in an Application Server
Installing XSU in a Web Server
Running the XSU Demo Programs
Using the XSU Command-Line Utility
Generating XML with the XSU Command-Line Utility
Generating XMLType Data with the XSU Command-Line Utility
Performing DML with the XSU Command-Line Utility
Programming with the XSU Java API
Generating a String with OracleXMLQuery
Running the testXMLSQL Program
Generating a DOM Tree with OracleXMLQuery
Paginating Results with OracleXMLQuery
Limiting the Number of Rows in the Result Set
Keeping the Object Open for the Duration of the User's Session
Paginating Results with OracleXMLQuery: Example
Generating Scrollable Result Sets
Generating XML from Cursor Objects
Inserting Rows with OracleXMLSave
Inserting XML into All Columns with OracleXMLSave
Inserting XML into a Subset of Columns with OracleXMLSave
Updating Rows with OracleXMLSave
Updating with Key Columns with OracleXMLSave
Updating a Column List with OracleXMLSave
Deleting Rows with OracleXMLSave
Deleting by Row with OracleXMLSave
Deleting by Key with OracleXMLSave
Handling XSU Java Exceptions
Obtaining the Parent Exception
Raising a No Rows Exception
Programming with the XSU PL/SQL API
Generating XML from Simple Queries with DBMS_XMLQuery
Specifying Element Names with DBMS_XMLQuery
Paginating Results with DBMS_XMLQuery
Setting Stylesheets in XSU
Binding Values in XSU
Inserting XML with DBMS_XMLSave
Inserting Values into All Columns with DBMS_XMLSave
Inserting into a Subset of Columns with DBMS_XMLSave
Updating with DBMS_XMLSave
Updating with Key Columns with DBMS_XMLSave
Specifying a List of Columns with DBMS_XMLSave: Example
Deleting with DBMS_XMLSave
Deleting by Row with DBMS_XMLSave: Example
Deleting by Key with DBMS_XMLSave: Example
Handling Exceptions in the XSU PL/SQL API
Reusing the Context Handle with DBMS_XMLSave
Tips and Techniques for Programming with XSU
How XSU Maps Between SQL and XML
Default SQL to XML Mapping
Default XML to SQL Mapping
Customizing Generated XML
How XSU Processes SQL Statements
How XSU Queries the Database
How XSU Inserts Rows
How XSU Updates Rows
How XSU Deletes Rows
How XSU Commits After DML
12
Using the TransX Utility
Introduction to the TransX Utility
Prerequisites
TransX UtilityFeatures
Simplified Multilingual Data Loading
Simplified Data Format Support and Interface
Additional TransX Utility Features
Using the TransX Utility: Overview
Using the TransX Utility: Basic Process
Running the TransX Utility Demo Programs
Using the TransX Command-Line Utility
TransX Utility Command-Line Options
TransX Utility Command-Line Parameters
Loading Data with the TransX Utility
Storing Messages in the Database
Creating a Dataset in a Predefined Format
Format of the Input XML Document
Specifying Translations in a Dataset
Loading the Data
Querying the Data
13
Data Loading Format (DLF) Specification
Introduction to DLF
Naming Conventions for DLF
Elements and Attributes
Values
File Extensions
General Structure of DLF
Tree Structure of DLF
DLF Specifications
XML Declaration in DLF
Entity References in DLF
Elements in DLF
Top Level Table Element
Translation Elements
Lookup Key Elements
Metadata Elements
Data Elements
Attributes in DLF
DLF Attributes
XML Namespace Attributes
DLF Examples
Minimal DLF Document
Typical DLF Document
Localized DLF Document
DLF References
14
Using the XSQL Pages Publishing Framework
Introduction to the XSQL Pages Publishing Framework
Prerequisites
Using the XSQL Pages Publishing Framework: Overview
Using the XSQL Pages Framework: Basic Process
Setting Up the XSQL Pages Framework
Creating and Testing XSQL Pages with Oracle JDeveloper
Setting the CLASSPATH for XSQL Pages
Configuring the XSQL Servlet Container
Setting Up the Connection Definitions
Running the XSQL Pages Demo Programs
Setting Up the XSQL Demos
Running the XSQL Demos
Using the XSQL Pages Command-Line Utility
Generating and Transforming XML with XSQL Servlet
Composing XSQL Pages
Using Bind Parameters
Using Lexical Substitution Parameters
Providing Default Values for Bind and Substitution Parameters
How the XSQL Page Processor Handles Different Types of Parameters
Producing Datagrams from SQL Queries
Transforming XML Datagrams into an Alternative XML Format
Transforming XML Datagrams into HTML for Display
Using XSQL in Java Programs
XSQL Pages Tips and Techniques
XSQL Pages Limitations
Hints for Using the XSQL Servlet
Specifying a DTD While Transforming XSQL Output to a WML Document
Testing Conditions in XSQL Pages
Passing a Query Result to the WHERE Clause of Another Query
Handling Multi-Valued HTML Form Parameters
Invoking PL/SQL Wrapper Procedures to Generate XML Datagrams
Accessing Contents of Posted XML
Changing Database Connections Dynamically
Retrieving the Name of the Current XSQL Page
Resolving Common XSQL Connection Errors
Receiving "Unable to Connect" Errors
Receiving "No Posted Document to Process" When Using HTTP POST
Security Considerations for XSQL Pages
Installing Your XSQL Configuration File in a Safe Directory
Disabling Default Client Stylesheet Overrides
Protecting Against the Misuse of Substitution Parameters
15
Using the XSQL Pages Publishing Framework: Advanced Topics
Customizing the XSQL Configuration File Name
Controlling How Stylesheets Are Processed
Overriding Client Stylesheets
Controlling the Content Type of the Returned Document
Assigning the Stylesheet Dynamically
Processing XSLT Stylesheets in the Client
Providing Multiple Stylesheets
Working with Array-Valued Parameters
Supplying Values for Array-Valued Parameters
Setting Array-Valued Page or Session Parameters from Strings
Binding Array-Valued Parameters in SQL and PL/SQL Statements
Setting Error Parameters on Built-in Actions
Using Conditional Logic with Error Parameters
Formatting XSQL Action Handler Errors
Including XMLType Query Results in XSQL Pages
Handling Posted XML Content
Understanding XML Posting Options
Producing PDF Output with the FOP Serializer
Performing XSQL Customizations
Writing Custom XSQL Action Handlers
Implementing the XSQLActionHandler Interface
Using Multivalued Parameters in Custom XSQL Actions
Implementing Custom XSQL Serializers
Techniques for Using a Custom Serializer
Assigning a Short Name to a Custom Serializer
Using a Custom XSQL Connection Manager for JDBC Datasources
Writing Custom XSQL Connection Managers
Accessing Authentication Information in a Custom Connection Manager
Implementing a Custom XSQLErrorHandler
Providing a Custom XSQL Logger Implementation
Part II XDK for C
16
Getting Started with C XDK Components
Installing C XDK Components
Configuring the UNIX Environment for C XDK Components
C XDK Component Dependencies on UNIX
Setting C XDK Environment Variables on UNIX
Testing the C XDK Runtime Environment on UNIX
Setting Up and Testing the C XDK Compile-Time Environment on UNIX
Testing the C XDK Compile-Time Environment on UNIX
Verifying the C XDK Component Version on UNIX
Configuring the Windows Environment for C XDK Components
C XDK Component Dependencies on Windows
Setting C XDK Environment Variables on Windows
Testing the C XDK Runtime Environment on Windows
Setting Up and Testing the C XDK Compile-Time Environment on Windows
Testing the C XDK Compile-Time Environment on Windows
Using the C XDK Components with Visual C/C++ on Windows
Setting a Path for a Project in Visual C/C++ on Windows
Setting the Library Path in Visual C/C++ on Windows
Overview of the Unified C API
Globalization Support for the C XDK Components
17
Using the XSLT and XVM Processors for C
XVM Processor
XVM Usage Example
Using the XVM Processor Command-Line Utility
Accessing XVM Processor for C
XSLT Processor
XSLT Processor Usage Example
XPath Processor Usage Example
Using the C XSLT Processor Command-Line Utility
Accessing Oracle XSLT processor for C
Using the Demo Files Included with the Software
Building the C Demo Programs for XSLT
18
Using the XML Parser for C
Introduction to the XML Parser for C
Prerequisites
Standards and Specifications
Using the XML Parser for C
Overview of the Parser API for C
XML Parser for C Datatypes
XML Parser for C Defaults
XML Parser for C Calling Sequence
Using the XML Parser for C: Basic Process
Running the XML Parser for C Demo Programs
Using the C XML Parser Command-Line Utility
Using the XML Parser Command-Line Utility: Example
Using the DOM API for C
Controlling the Data Encoding of XML Documents for the C API
Using NULL-Terminated and Length-Encoded C API Functions
Handling Errors with the C API
Using orastream Functions
Using the SAX API for C
Using the XML Pull Parser for C
Using Basic XML Pull Parsing Capabilities
XML Event Context
About the XML Event Context
Parsing Multiple XML Documents
ID Callback
Error Handling for the XML Pull Parser
Parser Errors
Programming Errors
Sample Pull Parser Application
An XML Pull Parser Sample Application
Sample Document
Events Generated by XML Pull Parser Sample Application
Using OCI and the XDK C API
Using XMLType Functions and Descriptions
Initializing an XML Context for XML DB
Creating XMLType Instances on the Client
Operating on XML Data in the Database Server
Using OCI and the XDK C API: Examples
19
Using Binary XML for C
Introduction to Binary XML for C
Prerequisites
Binary XML Storage Format
20
Using the XML Schema Processor for C
Oracle XML Schema Processor for C
Oracle XML Schema for C Features
Standards Conformance
XML Schema Processor for C: Supplied Software
Using the C XML Schema Processor Command-Line Utility
XML Schema Processor for C Usage Diagram
How to Run XML Schema for C Sample Programs
What is the Streaming Validator?
Using Transparent Mode
Error Handling in Transparent Mode
Streaming Validator Example
Using Opaque Mode
Error Handling in Opaque Mode
Example of Opaque Mode Application
Enhancement of the Existing XmlSchemaLoad() Function
Validation Options
21
Determining XML Differences Using C
Overview of XMLDiff in C
Flow of Process for XMLDiff
Using XmlDiff
User Options for Optimization
User Option for Hashing
How XmlDiff Looks at Input Documents
Using the XmlDiff Command-Line Utility
Sample Input Document
Sample Xdiff Instance Document
Output Model and XML Processing Instructions
Xdiff Operations
Format of Xdiff Instance Document
Xdiff Schema
Using XMLDiff in an Application
Customized Output
Using XmlPatch
Using the XmlPatch Command-Line Utility
Using XmlPatch in an Application
Using XmlHash
Calling XmlDiff and XmlPatch
22
Using SOAP with the C XDK
Introduction to SOAP for C
SOAP Messaging Overview
SOAP Message Format
Using SOAP Clients
Using SOAP Servers
SOAP C Functions
SOAP Example 1: Sending an XML Document
SOAP Example 2: A Response Asking for Clarification
SOAP Example 3: Using POST
Part III Oracle XDK for C++
23
Getting Started with C++ XDK Components
Installing the C++ XDK Components
Configuring the UNIX Environment for C++ XDK Components
C++ XDK Component Dependencies on UNIX
Setting C++ XDK Environment Variables on UNIX
Testing the C++ XDK Runtime Environment on UNIX
Setting Up and Testing the C++ XDK Compile-Time Environment on UNIX
Testing the C++ XDK Compile-Time Environment on UNIX
Verifying the C++ XDK Component Version on UNIX
Configuring the Windows Environment for C++ XDK Components
C++ XDK Component Dependencies on Windows
Setting C++ XDK Environment Variables on Windows
Testing the C++ XDK Runtime Environment on Windows
Setting Up and Testing the C++ XDK Compile-Time Environment on Windows
Testing the C++ XDK Compile-Time Environment on Windows
Using the C++ XDK Components with Visual C/C++
24
Overview of the Unified C++ Interfaces
What is the Unified C++ API?
Accessing the C++ Interface
OracleXML Namespace
OracleXML Interfaces
Ctx Namespace
OracleXML Datatypes
Ctx Interfaces
IO Namespace
IO Datatypes
IO Interfaces
Tools Package
Tools Interfaces
Error Message Files
25
Using the XML Parser for C++
Introduction to Parser for C++
DOM Namespace
DOM Datatypes
DOM Interfaces
DOM Traversal and Range Datatypes
DOM Traversal and Range Interfaces
Parser Namespace
GParser Interface
DOMParser Interface
SAXParser Interface
SAX Event Handlers
Thread Safety
XML Parser for C++ Usage
XML Parser for C++ Default Behavior
C++ Sample Files
26
Using the XSLT Processor for C++
Accessing XSLT for C++
Xsl Namespace
Xsl Interfaces
XSLT for C++ DOM Interface Usage
Invoking XSLT for C++
Command Line Usage
Writing C++ Code to Use Supplied APIs
Using the Sample Files Included with the Software
27
Using the XML Schema Processor for C++
Oracle XML Schema Processor for C++
Oracle XML Schema for C++ Features
Online Documentation
Standards Conformance
XML Schema Processor API
Invoking XML Schema Processor for C++
Running the Provided XML Schema for C++ Sample Programs
28
Using the XPath Processor for C++
XPath Interfaces
Sample Programs
29
Using the XML Class Generator for C++
Accessing XML C++ Class Generator
Using XML C++ Class Generator
External DTD Parsing
Error Message Files
Using the XML C++ Class Generator Command-Line Utility
Input to the XML C++ Class Generator
Using the XML C++ Class Generator Examples
XML C++ Class Generator Example 1: XML — Input File to Class Generator, CG.xml
XML C++ Class Generator Example 2: DTD — Input File to Class Generator, CG.dtd
XML C++ Class Generator Example 3: CG Sample Program
Part IV Oracle XDK Reference
30
XSQL Pages Reference
XSQL Configuration File Parameters
<xsql:action>
<xsql:delete-request>
<xsql:dml>
<xsql:if-param>
<xsql:include-owa>
<xsql:include-param>
<xsql:include-posted-xml>
<xsql:include-request-params>
<xsql:include-xml>
<xsql:include-xsql>
<xsql:insert-param>
<xsql:insert-request>
<xsql:query>
<xsql:ref-cursor-function>
<xsql:set-cookie>
<xsql:set-page-param>
<xsql:set-session-param>
<xsql:set-stylesheet-param>
<xsql:update-request>
31
XDK Standards
XML Standards Supported by the XDK
Summary of XML Standards Supported by the XDK
XML Standards for the XDK for Java
DOM Standard for the XDK for Java
XSLT Standard for the XDK for Java
JAXB Standard for the XDK for Java
Pipeline Definition Language Standard for the XDK for Java
Character Sets Supported by the XDK
Character Sets Supported by the XDK for Java
Character Sets Supported by the XDK for C
A
Oracle XDK for Java XML Error Messages
XML Parser Error Messages
DOM Error Messages
XSL Transformation Error Messages
XPath Error Messages
XML Schema Validation Error Messages
Schema Representation Constraint Error Messages
Schema Component Constraint Error Messages
XSQL Server Pages Error Messages
XML Pipeline Error Messages
Java API for XML Binding (JAXB) Error Messages
B
Oracle XDK for Java TXU Error Messages
General TXU Error Messages
DLF Error Messages
TransX Informational Messages
TransX Error Messages
Assertion Messages
Usage Description Messages
C
Oracle XDK for Java XSU Error Messages
Keywords and Syntax for Error Messages
Generic Error Messages
Query Error Messages
DML Error Messages
Pieces of Error Messages
Glossary
Index
Scripting on this page enhances content navigation, but does not change the content in any way.