Skip Headers

Oracle® XML Developer's Kit Programmer's Guide
10g Rele ase 1 (10.1)

Part Number B10794-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback


Next
View PDF

Contents

Title and Copyright Information

Send Us Your Comments

Preface< /h3>
Audience
Organization
Related Documentation
Conventions
Documentation Accessibility

What's N ew in XDK?

Features Introduced in Oracle XML Developer's Kit 10g Re lease 1 (10.1)

1 Overview of XML Developer's Kit Components

Introducing Oracle XML Develo per's Kit
Overview of Oracle XDK Components
XDK Functionality Applied to XML Documents
XML Parsers
XSL Transformation (XSLT) Processors
JAXB and C++ Class Generators
XML Schema Processor
XDK JavaBeans
DOMBuilder
XSLTrans former
DBAccess
XMLDiff
XMLCompress
XMLDBAccess
XSDValidator
Oracle XML SQL Utility (XSU) for Java
XSQL Pages Publishing Framework
TransX Utility
Soap Services
Using XDK-supported Languages to Ge nerate XML Documents
Using XSU for Java to Generate XML Documents
Generating XML from Query Results
XML Documen t Structure: Columns Are Mapped to Elements
XSU Generates the XML Document as a String o r DOM Element Tree
XSU Generates a DTD Based on Queried Table's Schema
Using Oracle XDK Java Components to Generate XML Documents
Using Oracle XDK C Components to Generate XML Documents
Using Oracle XDK C++ Co mponents to Generate XML Documents
XDK and Application Development Tools
Browsers That Support XML
Oracle XML G ateway
Oracle Data Provider for .NET
JDevel oper
Business Components for Java (BC4J)
Us er Interface XML (UIX)
Oracle Reports
Recom mended Books and Web Sites About XML
Using Oracle XML-Enabled Technology< /dd>
Information for Using the XDK
Using Apache Web Server Instead of the Oracle9i Application Server
Need f or an XML Parser If all the XML Was Created By Programs
SQL*Loader and Nesting in XML D ocuments
Information About Previous Oracle Releases
Using Oracle Database Version 7 and XML
Doing Data Trans fers to Other Vendors Using XML from Oracle Release 7.3.4
Using Versions Prior to Oracl e8i and Oracle XML Tools?
XML Standards That Oracle Supports
B2B Standards and Development Tools that Oracle Supports
Oracle Corporation's Direction Regarding XML
Oracle Corporation's Pl ans for XML Query
Maximum XML File Sizes
Limitations on the Size of an XML File
Size Limit for XML Documents Generated from the Database
Maximum Size for an XML Document for PL/SQL
< /dd>

2 Getti ng Started with XDK Java Components

XDK Java Components Specifications< /dd>
DOM Specifications
XSL Transformati ons Specifications
Installing XDK Java Components
XDK Java Components Directory Structure
XDK Java Components Environm ent Settings
UNIX Environment Settings for XDK Java Components
< a href="adx02get.htm#sthref146">Windows Environment Settings for XDK Java Components
Setting Up XSQL Servlet
Servlet Engines
Java Server Pages Implementations
JDBC Drivers and Databases
Setting Up the Database Connection Definitions for Your Environment
Setting Up Your Servlet Engine to Run XSQL Pages
Oracle App lication Server (OracleAS)
OracleAS Oracle Containers for Java (OC4J) Servlet Container
Apache/JServ 1.0 or 1.1
Jakarta Tomcat 3 .1 or 3.2
XDK Java Components Globalization Support
XDK Java Components Dependencies
Verifying the XDK Java Components Version

3 XML Parser for Java

XML Parser for Java Overview
Namespace Support
XML Parser for Java Validation Modes
Using DTDs with the XML Parser for Java
Enabling DTD Caching
Recognizing External DTDs
Loading External DTDs from a JAR File
Checking the Correctness of Constructed XML Documents
Parsing a DTD Object Separately from an XML Document
XML Parsers Case-Sensitivity
Allowed File Extens ions in External Entities
Creating a DOCUMENT_TYPE_NODE
Standard DTDs That Can be Used for Orders, Shipments, and So On
About DOM and SAX APIs
DOM: Tree-Based API
SAX: Event-Based API
Guidelines for Using DOM and SAX APIs< /dd>
DOM
SAX
About XML Compressor
XML Serialization and Compression
Running the Sample Applications for XML Parser for Java< /dd>
Using XML Parser for Java: DOMParser Class
Without DTD Input
With a DTD Input
Comments on Example 1: DOMSample.java
XML Parser for Java Example 1: DOMSample.java
Using XML Parser for Java: DOMNamespace Class
XML Parser for Java Example 2: Parsing a URL — DOMNamespace.java
Using XML Parser for Java: SAXParser Class
XML Parser for Java Example 3: Using the Parser and SAX API (SAXSample.java)
XML Parser for Java Examp le 4: (SAXNamespace.java)
Using the XML Parser for Java
Using DOM and SAX APIs for Java
Using the DOM API to Count Tagged Elements
Creating a Node with a Value to Be Set Later
Traversing the XML Tree Using XPATH
Finding the Fi rst Child Node Element Value
Using the XMLNode.selectNodes() Method
Generating an XML Document from Data in Variables
Using the DOM API to Print Data in the Element Tags
Building XML Files from Hash Table Value Pair s
DOM Exception WRONG_DOCUMENT_ERR on Node.appendChild()
Getting DOMException when Setting Node Value
Extracting Embedded XML fr om a CDATA Section
Using Character Sets with the XML Parser for Java
Reading a Unicode XML File
Writing an X ML File in UTF-8
Writing Parsing XML Stored in NCLOB with UTF-8 Encoding
< a href="adx04paj.htm#sthref292">Parsing a Document Containing Accented Characters
Stori ng Accented Characters in an XML Document
You Cannot Dynamically Set the Encoding for a n Input XML File
Using System.out.println() and Special Characters
< dd>General Questions About XML Parser for Java
Including Binary Data in an XML Document
Displaying an XML Document
Including an External XML File in Another XML File
You Do Not Need Oracle9i or Higher to Run XML Parser for Java
Inserting Characters & lt;, >, ', ", and & into XML Documents
Invalid Special Characters in Tags
Parsing XML from Data of Type String
Extracting Data from an XML Document into a String
Illegal Characters in XML Documents
< dd>Using Entity References with the XML Parser for Java
Merging XML Documents
The XML Parser for Java Does Not Need a Utility to View the Par sed Output
Support for Hierarchical Mapping
Support for Ambiguous Content Mode
Generating an XML Document Based on Two Tables
Using JAXP
oraxml: XML Parser for Java Command-line

4 XSLT Processor for Java

XSLT Processor for Java Overview
Using XSLT Processor for Java
XSLT Processor for Java Example
XSLT Command-Line Interface: oraxsl
XML Extension Functions for XSLT Processing
XSLT Processor for Java Extension Functions and Namespaces
Static Versus Non-Static Methods
XML Parser for Java - XSL Example 1: Static function
Constructor Extension Function
XML P arser for Java - XSL Example 2: Constructor Extension Function
Return Value E xtension Function
XML Parser for Java XSL- XSL Example 3: Return Value Extens ion Function
Datatypes Extension Function
XML Parser for Java - XSL Example 4: Datatype Extension Function
XSLT Processor for Java Built-In Extensions: ora:node-set and ora:output
ora:output
ora:node-set
Example of U se of Oracle XSL Extensions
Hints for Using the XSLT Processor for Java and XSL
Merging Two XML Documents
Example: Using importNode() from DOM Level 2
Example: Using adoptNode from DOM Level 3
Example: demo1.xml
Exam ple: demo2.xml
Example: demomerge.xsl
Extracting Embedded XML Using Only XSLT
Support of Output Method "html" in the X SL Parser
Creating an HTML Input Form
Cor rect XSL Namespace URI
XSL Processor Produces Multiple Outputs
Keeping White Spaces in Your Output
XDK Utilities That Translate Data from Other Formats to XML
Multiple Threads Using a Single XSLProcessor and Stylesh eet
Using Document Clones in Multiple Threads
Disabling Output Escaping Is Supported

5 XML Schema Processor for Java

W hat Is XML Schema?
What Are DTDs?
DTD Limitations
Comparison of XML Schema Features to DTD Features
XML Schema Processor for Java Features
Supported Character Sets
Requirements to Run XML Schema Processor for Java
XML Schema Processor for Java Usage
Using the XML Schema API
XML Schema Processor for Java Sample Programs

6 Using JAXB Cla ss Generator

What Is JAXB?
Re placing the XML Class Generator with JAXB Class Generator
Unmarshalling, Marshalling, a nd Validating Using JAXB
Using JAXB Class Generator
Features Not Supported in JAXB
JAXB Class Generator Command-Line Interface
JAXB Compared with JAXP

7 XML SQL Utility (XSU)

What Is XML SQL Utility (XSU)?
Generating XML from the Database
Storing XML in the Database
Accessing XSU Functi onality
XSU Features
XSU Depend encies and Installation
Dependencies of XSU
Installing XSU
Where XSU can be Installed
XML SQL Utility in the Database
XML SQL Utility in th e Middle Tier
XML SQL Utility in a Web Server
SQL-to-XML and XML-to-SQL Mapping Primer
Default SQL-to-XML Ma pping
SQL-to-XML Mapping Against Object-Relational Schema
Customizing the Generated XML: Mapping SQL to XML
Source Customizations
Mapping Customizations
Post-Generation Customizations
Default XML-to-SQL Mapping
How XML SQL Utility Works
Selecting with XSU
Queries That XSU Cannot Handle
Inserting with XSU
Updating with XSU
Deleting with XSU
Using the XSU Command-Line Front End OracleXML
Generating XML Using the XSU Command Line
XSU's OracleXML getXML Options
Inserting XML Using XSU's Command Line (putXML)< /dd>
XSU OracleXML putXML Options
XSU Ja va API
Generating XML with XSU's OracleXMLQuery
Generating XML from SQL Queries Using XSU
XSU Generating XML Example 1 : Generating a String from Table employees (Java)
How to Run This Program
XSU Generating XML Example 2: Generating DOM from Table employees (Java)
Paginating Results: skipRows and maxRows
Keeping the Object Open for the Duration of the User's Session
When the Nu mber of Rows or Columns in a Row Is Too Large
keepObjectOpen Function
XSU Generating XML Example 3: Paginating Results: (Java)
Generating XML from ResultSet Objects
XSU Generating XML Example 4: Generating XML from JDBC ResultSets (Java)
XSU Generating XML Example 5: Generating XML from Procedure Return Values
Raising NoRowsException
XSU Generating XML Example 6: No Rows Exception (Java)
Storing XML Back in the Database Using XSU OracleXMLSave
Insert Processing U sing XSU (Java API)
XSU Inserting XML Example 7: Inserting XML Values into Al l Columns (Java)
XSU Inserting XML Example 8: Inserting XML Values into Columns (Java)< /a>
Update Processing Using XSU (Java API)
XSU Updating XML Example 9: Updating a Table Using the keyColumns (Java)
XSU Updating XML Example 10: Updating a Specified List of Columns (Java)
Delete Processing Using XSU (Java API)
XSU Deleting XML Example 11: Deleting Operations Per Row (Java)
XSU Deleting XML Example 12: Deleting Specified Key Values (J ava)
Advanced XSU Usage Techniques
XSU Exception Handling in Java
OracleXMLSQLException Class< /dd>
OracleXMLNoRowsException Class
Hint s for Using XML SQL Utility (XSU)
Schema Structure to use with XSU to Store X ML
Storing XML Data Across Tables
Using X SU to Load Data Stored in Attributes
XSU is Case-Sensitive
XSU Cannot Generate the Database Schema from a DTD
Thin Driver Connec t String Example for XSU
XSU and COMMIT After INSERT, DELETE, or UPDATE
Mapping Table Columns to XML Attributes Using XSU

8 XSQL Pages Publishing Framework< /h3>
XSQL Pages Publishing Framework Overview
What Can I Do with Oracle XSQL Pages?
Where Can I Obtain Oracle XSQL Pages?< /a>
What Is Needed to Run XSQL Pages?
Security Considerations for XSQL Pages
Install Your XSQLConfig.xml File in a Safe Directory
Disable Default Client Stylesheet Overrides
Be Alert for the Use of Substitution Parameters
What's N ew in XSQL Pages Release 10.1
Overview of Basic XSQL Pages Features
Producing XML Datagrams from SQL Queries
Transform ing XML Datagrams into an Alternative XML Format
Transforming XML Datagrams into HTML f or Display
Setting Up and Using XSQL Pages in Your Environment
Using XSQL Pages with Oracle JDeveloper
Setti ng the CLASSPATH Correctly in Your Production Environment
Setting Up the Connection Def initions
Using the XSQL Command-Line Utility
Overview of All XSQL Pages Capabilities
Using All of the Core B uilt-in Actions
The <xsql:query> Action
The <xsql:dml> Action
The <xsql:ref-cursor-function> Action< /a>
The <xsql:include-owa> Action
Using Bind Variables
Using Lexical Substitution Parameters
Providing Default Values for Bind Variables and Parameters
Understanding t he Different Kinds of Parameters
The <xsql:include-request-params> Action
The <xsql:include-param> Action
The <xs ql:include-xml> Action
The <xsql:include-posted-xml> Action
The <xsql:set-page-param> Action
The <xsql:set-ses sion-param> Action
The <xsql:set-cookie> Action
The <xsql:set-stylesheet-param> Action
Working with Arr ay-Valued Parameters
Setting Array-Valued Page or Session Parameters from Strings
Binding Array-Valued Parameters in SQL and PL/SQL Statements
Supplying Multi-Valued Parameters on the Command Line
Supplying Multi-Va lued Parameters Programmatically with XSQLRequest
Conditionally Executing Actions or In cluding Content with <xsql:if-param>
Optionally Setting an Error Parameter on Any Built-in Action
Aggregating Information Using <xsql:include-xsql>
< a href="adx09xsq.htm#sthref710">Including XMLType Query Results
Handling Posted Informa tion
Understanding Different XML Posting Options
Using Custom XSQL Action Handlers
Description of XSQL Servlet Examples
Setting Up the Demo Data
Advanced XSQL Pages Topics
Using a Custom XSQL Conf iguration File Name
Understanding Client Stylesheet-Override Options
Controlling How Stylesheets Are Processed
Control ling the Content Type of the Returned Document
Assigning the Stylesheet Dynamically
Processing Stylesheets in the Client
Providi ng Multiple, UserAgent-Specific Stylesheets
Using XSQL Configuration File to Tune Your Environment
Using the FOP Serializer to Produce PDF Output
Using XSQL Page Processor Programmatically
Writing Custom X SQL Action Handlers
Writing your Own Action Handler
Using Multi-Valued Parameters in Custom XSQL Actions
Wri ting Custom XSQL Serializers
Using a Custom XSQL Connection Manager for JDBC Datasource s
Writing Custom XSQL Connection Managers
Providing a Custom XSQLErrorHandler Implementation
Providing a Custom XSQL Logger Impl ementation
Formatting XSQL Action Handler Errors
Displaying Error Information on Screen
XSQL Servl et Limitations and Hints
HTTP Parameters with Multibyte Names
CURSOR() Function in SQL Statements
Hints for Using the XSQL Servlet
Specifying a DTD While Transforming XSQL Output to a WML Documen t
Writing XSQL Servlet Conditional Statements
Using a Value Retrieved in One Query in Another Query's Where Clause
Using the XSQ L Servlet with Non-Oracle Databases
Using the XSQL Servlet to Access the JServ Process< /a>
Running XSQL on Oracle8i Lite and Apache Jserv Web Server
Handling Multi-Valued HTML Form Parameters
Running the XSQL S ervlet with Oracle Release 7.3
Out Variable is not Supported in <xsql:dml>
Receiving "Unable to Connect" Errors
Using Othe r File Extensions Besides .xsql
Receiving "No Posted Document to Process" when you Try to Post XML
XSQL Supports SOAP
Passing th e Connection for XSQL
Controlling How Database Connections and Passwords Are Stored
Accessing Authentication Information in a Custom Connection Manager
Retrieving the Name of the Current XSQL Page
Resolving Errors W hen Using the FOP Serializer
Tuning XSQL Pages for Fastest Performance
Using XSQL with Other Connection Pool Implementations
Inc luding XML Documents Stored in CLOBs in Your XSQL Page
Combining JavaServer Pages and X SQL in the Same Page
Choosing a Stylesheet Based on Input Arguments
Sorting the Result Within the Page

9 Pipeline Definition Language for Java

Using Pipeline Definition Language
Example of a Pipe line Definition Language Application
The Command-line Pipeline Tool orapipe

10 XDK JavaBeans< /a>

Accessing Oracle XDK JavaBeans
Database Connectivity
XDK JavaBeans Overview
DOMBuilder
XSLTransformer
DBAccess
XMLDiff
XMLCompress
XMLDBAccess
XSDValidator
< /dd>
DOMBuilder JavaBean
Use for Asynchr onous Parsing in the Background
DOMBuilder JavaBean Usage
XSLTransformer JavaBean
XSLTransformer JavaBean: R egenerating HTML Only When Data Changes
How to Use XSLTransformer JavaBean
DBAccess JavaBean
DBAcess JavaBea n Usage
XMLDiff JavaBean
XMLCom press JavaBean
XMLDBAccess JavaBean
XSDVa lidator JavaBean
JavaBean Examples
Installing the JavaBean Examples
XMLDiffSample.java
XSDValidatorSample.java

11 Using XDK and SOAP

What Is SOAP?
What Are UDDI and WSDL?
What Is Oracle SOAP?
How Does Oracle SOAP Work?
Ora cle SOAP and IDAP
What Is a SOAP Client?
SOAP Client API
What Is a SOAP Server?
Or acle SOAP Security Features
SOAP Transports
Administrative Clients
SOAP Request Handler
SOAP Provider Interface and Providers
Provider Interface
< a href="adx11soa.htm#sthref897">Provider Deployment Administration
SOAP Services Provid ed
Advantages of XML Over EDI
SOAP Example
XML Features Used in the SOAP Example
Prerequisite Software for the SOAP Example
How Is the SOAP Example Implemented?
Setting Up the Tables and the SOAP Service
Requesting SOAP Service
Initializing the MessageDispa tcher Process
Compressing the XML Document
Creating a SOAP Message
Enqueuing the XML Document
Listing of the Java Source File inserItemServlet.java
Queuing Messages with AQ
XML Compression
Listing of the Java S ource File MessageBroker.java
Summary of the SOAP Example
< /dl>

12 TransX Utility

Overview of the TransX Utility
Primary TransX Utility Features
Simplified Multilingual Data Loading
Simplified Data Format Support and Interface
Loading Dataset in the Standard XML Format
Handling Existing Data
Other TransX Utility Features
Install ing TransX Utility
Dependencies of TransX
Installing TransX Using the Oracle Installer
Installing TransX Downloaded fr om OTN
To Use the TransX Front-end or Its Java API:
TransX Utility Command-Line Syntax
T ransX Utility Command-Line Examples
TransX Utility Command-line Parameters
TransX Utility Command-line Options
Sample Code for TransX Utility

13 Getting Started with XDK C Components

Spe cifications of XDK C/C++ Components
What Are the XDK C Components
Installing the C Components of XDK
Setting the UNIX Environment
Command Line Environment Setup
Setting the Windows Environment
Environment for Command Line Usage
Using the XDK C Components with Visual C++
Globalization Support for the C XDK Components

14 XML Parser for C

What I s the Unified C API for XDK and Oracle XML DB?
Using DOM for XDK
Loading an XML Document with the C API
Data Encoding of XML Documents for the C API
NULL-Terminated and Length-Encoded C API Functions
Error Handling
Installing the C API
Using OCI and the C API
XML Con text
Creating XMLType Instances on the Client
XML Data on the Server
XMLType Functions and Descriptions
OCI Examples
Using the XML Parser for C
Memory Allocation
Thread Safety
Data Types Index
Error Message Files
XML Parser for C Calling Sequence
Parser Calling Sequence
XML Parser for C Default Behavior
DOM and SAX APIs Compared
Using the SAX API
SAX Callback Structure
Command Line Usage
Writing C Code to Use Supplied APIs
Using the Sample Files

15 XSLT Processors for C

XVM Proces sor
XVM Usage Example
Command -Line Access of the XVM Processor
Accessing XVM Processor for C
XSL Processor
XSL Processor Usage Example
XPath Processor Usage Example
Command Line Usage of the XSL Processor
Accessing Oracle XSL Processor for C
Using the Demo Files Included with the Software
Building the C Demo Programs for XSLT

16 XML Schema Processor for C

Oracle XML Schema Processor for C
Oracle XML Schema for C Features< /dd>
Standards Conformance
XML Schema Processor for C: Supplied Software
Invoking XML Schema Processor for C
XML Schema Processor for C Usage Diagram
How to Run XM L Schema for C Sample Programs

17 Getting Started with XDK C++ Components

Installatio n of the XDK C++ Components
Getting the C++ Components of XDK
< a href="adxgtcpp.htm#sthref1059">Libraries in the UNIX Environment for C++ XDK
Setting the UNIX Environment for C++
Command Line Environment Setup
Windows Environment Setup for C++ XDK
Environment for Command Line Usage on Windows
Setting the Windows Environment for C++ XDK
Using XDK C++ Components with Visual C++

18 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
< dd>
Tools Interfaces
Error Messag e Files

19 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 Na mespace
GParser Interface
DOM Parser Interface
SAXParser Interface
SAX Event Handlers
Thread Safety
XML Parser for C++ Usage
XML Parser for C++ Default Behavior
C++ Sample Files

20 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

21 XML Schema Processor for C++

Oracle XML Schema Processor for C++
Oracle XML Schema for C++ Features
Online Documentation
Sta ndards Conformance
XML Schema Processor API
Invoking XML Schema Processor for C++
Running the P rovided XML Schema for C++ Sample Programs

22 XPath Processor for C++

XPath Interface s
Sample Programs

23 XML Class Generator for C++

Accessing XML C++ Class Generator
Using XML C++ Class Generator
External DTD Parsing
Error Message Files
XML C++ Class Generator Usage
Input to the XML C++ Class Generator
Using the XML C++ Class Gener ator 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
< /dl>

24 XSU for P L/SQL

XSU PL/SQL API
Generating XML with DBMS_XMLQuery()
XSU Generating XML Example 1: Generating XML f rom Simple Queries (PL/SQL)
XSU Generating XML Example 2: Printing CLOB to Output Buff er
XSU Generating XML Example 3: Changing ROW and ROWSET Tag Names
XSU Generating XML Example 4: Using setMaxRows() and setSkipRows()
Setting Stylesheets in XSU (PL/SQL)
Binding Values in XSU (PL/SQL)< /a>
XSU Generating XML Example 5: Binding Values to the SQL Statement
Storing XML in the Database Using DBMS_XMLSave
Insert Processing Using XSU (PL/SQL API)
XSU Inserting XML Example 6 : Inserting Values into All Columns (PL/SQL)
XSU Inserting XML Example 7: Inserting Va lues into Certain Columns (PL/SQL)
Update Processing Using XSU (PL/SQL API)< /a>
XSU Updating XML Example 8: Updating XML Document Key Columns (PL/SQL)
XSU Updating XML Example 9: Specifying a List of Columns to Update (PL/SQL)
Delete Processing Using XSU (PL/SQL API)
XSU Deleting XML Example 10: Deleting Operations for Each Row (PL/SQL)
XSU Exam ple 11: Deleting by Specifying the Key Values (PL/SQL)
XSU Deleting XML Example 12: Re using the Context Handle (PL/SQL)
XSU Exception Handling in PL/SQL
< /dl>

Glossary

Index