Oracle has representatives participating actively in the following W3C Working Groups:

XML Core

XML Schema

XML Query

XSL/XPath

XLink/XPointer

XML Namespaces

DOM

SAX

Oracle has representatives participating actively on the following JSR standards:

JAXB

JAXP

Overview of Oracle XDK Components

The XDK is fully supported and comes with a commercial redistribution license. To provide a broad variety of deployment options, the XDK components are available for Java, C, and C++. Table 1-2 lists and describes the Oracle XDK components.

XDK Functionality Applied to XML Documents

To work with XML technology, you need to be familiar with the tools to parse XML, validate XML against a DTD or XML schema, transform XML by applying a stylesheet, and generate XML documents based on data selected from a database by means of SQL statements. See Table 1-2, "Overview of Oracle XDK Components ", column "See Also," for cross-references to the components. XML Compressor supports only Java. Figure 1-1 shows a simple overview of XDK.

XML Parsers

The XML Parsers read the XML document, and use either DOM APIs for navigating a tree-like representation of the XML document, or a Simple API for XML (SAX) event-based interface that requires less memory. The XML Parser for Java supports JAXP. JAXP enables processing of XML documents using DOM, SAX, and XSLT independently of the XML processor implementation. XML Compressor is also integrated into the parser. This reduces the size of XML message payloads.

XSL Transformation (XSLT) Processors

The Oracle XSLT engine fully supports the W3C XSL Transformations recommendation. It has the following features:

Enables standards-based transformation of XML information inside and outside the database on any operating system.

The Oracle XML Parsers include an integrated XSL Transformation (XSLT) Processor for transforming XML data using XSL stylesheets. Using the XSLT processor, you can transform XML documents from XML to XML, to HTML, or to virtually any other text-based format.

JAXB and C++ Class Generators

JAXB Class Generator creates a set of Java classes for creation of XML documents corresponding to an input XML Schema. JAXB does not support DTDs. These classes are then used in a Java application. The C++ Class Generator creates a set of C++ classes for creation of XML documents corresponding to an input DTD or XML Schema. These classes are then used in a C++ application.

JAXB Class Generator supports data binding. An XML instance document can be input to load the instance data at runtime directly into the generated classes from a DTD. This improves memory usage and performance compared to DOM APIs.

XML Schema Processor

XML Schema was created by the W3C to describe the content and structure of XML documents in XML, thus improving on DTDs. XML Schema Processor introduces the concept of datatypes to XML. This allows data to be exchanged between databases using XML syntax.

XDK JavaBeans

The Oracle XDK JavaBeans are a set of visual and non-visual beans that are useful in creating a variety of XML-enabled Java applications or applets. XDK JavaBeans comprises the following beans:

DOMBuilder

The DOMBuilder JavaBean is a non-visual bean. It builds a DOM Tree from an XML document.

XSLTransformer

The XSLTransformer JavaBean is a non-visual bean. It accepts an XML file, applies the transformation specified by an input XSL stylesheet and creates the resulting output file.

DBAccess

XMLDiff

XMLCompress

This JavaBean is an encapsulation of the XML compression functionality.

XMLDBAccess

This JavaBean is an extension of the DBAcess bean to support the XMLType column, in which XML documents are stored in an Oracle Database table.

XSDValidator

This JavaBean is a class file that encapsulates the oracle.xml.parser.schema.XSDValidator class and adds capabilities for validating a DOM tree.

Oracle XML SQL Utility (XSU) for Java

XML SQL Utility is comprised of core Java class libraries that:

Automatically and dynamically render the results of arbitrary SQL queries into canonical XML.

Support queries over richly-structured user-defined object types and object views, including XMLType.

XML SQL Utility Java classes can be used for the following tasks:

Load data from an XML document into an existing database schema or view.

Support automatic XML insert of canonically-structured XML into any existing table, view, object table, or object view. By combining with XSLT transformations, virtually any XML document can be automatically inserted into the database.

Note:

XSU for PL/SQL is also available. Oracle XML SQL Utility (XSU) for Java has these features.

XSQL Pages Publishing Framework

The XSQL Pages Publishing Framework (XSQL Servlet) is a server component that produces dynamic XML documents from one or more SQL queries of data objects. It does this by processing an XSQL file, which is simply an XML file with a specific structure and grammar. The XSQL Servlet uses Oracle's XML Parser to process this file and pass any XSLT processing statements to its internal XSLT Processor while passing the parameters and SQL statements between the tags to the XML SQL Utility. Results from those queries are then received as either XML-formatted text or a JDBC ResultSet object. If necessary, the query results can be further transformed into any desired format using the built-in XSLT processor.

TransX Utility

The Oracle TransX Utility is a data transfer utility that enables you to populate your database with multilingual data. It uses XML to specify the data, so that you can easily transfer from XML to the database. It uses a simple data format that is intuitive for both developers and translators and it uses a validation capability that is less error-prone than previous techniques.

Soap Services

Oracle SOAP Services is published, located and executed through the Web. It is transport protocol-independent and operating system-independent. SOAP Services provide the standard XML message format for all applications. With SOAP Services, you can build messaging, RPC, and Web service applications with XML standards.

Using XDK-supported Languages to Generate XML Documents

Each of the language components will be employed to generate XML documents.

Using XSU for Java to Generate XML Documents

XSU can render the results of arbitrary SQL queries into canonical XML.

XML Document Structure: Columns Are Mapped to Elements

Object types are mapped to elements with attributes appearing as sub-elements

Collections are mapped to lists of elements

XSU Generates the XML Document as a String or DOM Element Tree

The XML SQL Utility (XSU) supports SAX event stream. XSU also generates either of the following:

A string representation of the XML document. Use this representation if you are returning the XML document to a requester.

An in-memory XML DOM tree of elements. Use this representation if you are operating on the XML programmatically, for example, transforming it using the XSLT Processor using DOM methods to search or modify the XML in some way.

A series of SAX events which can be used when simply retrieving XML especially large documents or result sets.

XSU Generates a DTD Based on Queried Table's Schema

You can also use the XML SQL Utility (XSU) to generate a DTD or an XML Schema based on the schema of the underlying table or view being queried. You can use the generated DTD as input to the JAXB Class Generator for Java or the C++ Class Generator. This generates a set of classes based on the DTD elements. You can then write code that uses these classes to generate the infrastructure behind a Web-based form.

Based on this infrastructure, the Web form can capture user data and create an XML document compatible with the database schema. This data can then be written directly to the corresponding database table or object view without further processing.

To write an XML document to a database table, where the XML data does not match the underlying table structure, transform the XML document before writing it to the database. For techniques on doing this, see Chapter 7, " XML SQL Utility (XSU)".

In the Java environment, when a SQL query is sent, these are the possible ways of processing the query using the Oracle XDK components:

By the XSQL Servlet (this includes using XSU and XML Parser for Java)

Directly by the XSU (this includes XML Parser for Java)

Directly by JDBC which then accesses XML Parser

Regardless of which way the stored XML data is generated from the database, the resulting XML document output from the XML Parser for Java is further processed; it is formatted and customized by applying stylesheets and processed by the XSLT.

XDK and Application Development Tools

Figure 1-9 shows an overview of how the Oracle XML components enable development of E-business solutions.

A user who is a consumer or works for a business, sends SQL queries to an Oracle database either through a Java, C, or C++ application. These applications as well as development tools such as XSQL Pages Publishing Framework, JDeveloper, and so on, transform data from the database into XML documents. These XML documents are input to XML-based business solutions for data exchange with other users, content and data management, and other uses listed in the illustration.

Oracle XML Gateway

XML Gateway is a set of services that enables easy integration with the Oracle E-Business Suite to create and consume XML messages triggered by business events. It integrates with Oracle Streams Advanced Queuing to enqueue and dequeue a message which is then transmitted to or from the business partner through any message transport agent.

Oracle Data Provider for .NET

Oracle Data Provider for .NET (ODP.NET) is an implementation of a data provider for the Oracle Database.

ODP.NET uses Oracle native APIs to offer fast and reliable access to Oracle data and features from any .NET application. ODP.NET also uses and inherits classes and interfaces available in the Microsoft .NET Framework Class Library.

ODP.NET enables the extraction of data from relational and object-relational tables and views as XML documents using the Oracle XDK. The use of XML documents for insert, update, and delete operations to the database server is also allowed.

JDeveloper

Oracle JDeveloper is a J2EE development environment with end-to-end support for developing, debugging, and deploying e-business applications. JDeveloper empowers users with highly productive tools, such as the industry's fastest Java debugger, a new profiler, and the innovative CodeCoach tool for code performance analysis and improvement.

To maximize productivity, JDeveloper provides a comprehensive set of integrated tools that support the complete development life cycle, from source code control, modeling, and coding through debugging, testing, profiling, and deployment. JDeveloper simplifies J2EE development by providing wizards, editors, visual design tools, and deployment tools to create high-quality standard J2EE components, including applets, JavaBeans, Java Server Pages (JSP), servlets, and Enterprise JavaBeans (EJB). JDeveloper also provides a public API to extend and customize the development environment and seamlessly integrate it with external products.

The Oracle XDK is integrated into JDeveloper, offering many ways to create, handle, and transform XML. For example, with the XSQL Servlet, developers can query and manipulate database information, generate XML documents, transform the documents using XSLT stylesheets, and make them available on the Web.

JDeveloper has an integrated XML schema-driven code editor for working on XML Schema-based documents such as XML schemas and XSLT stylesheets, with tag insight to help you easily enter the correct elements and attributes as defined by the schema.

An XML Schema Definition defines the structure of an XML document and is used in the editor to validate the XML and help developers when typing. This feature is called Code Insight and provides a list of valid alternatives for XML elements or attributes in the document. Just by specifying the schema for a certain language, the editor can assist you in creating a document in that markup language.

Oracle JDeveloper simplifies the task of working with Java application code and XML data and documents at the same time. It features drag-and-drop XML development modules. These include the following:

XSQL Pages and Servlet support, where developers can edit and debug Oracle XSQL Pages, Java programs that can query the database and return formatted XML or insert XML into the database without writing code. The integrated servlet engine enables you to view XML output generated by Java code in the same environment as your program source, making it easy to do rapid, iterative development and testing.

Business Components for Java (BC4J)

Business Components for Java (BC4J) is JDeveloper's programming framework for building multitier database applications from reusable business components. Such applications typically consist of:

A client-side user interface written in Java and HTML.

One or more business logic tier components that provide business logic and views of business objects.

Tables on the database server that store the underlying data.

A multitier application built with the Business Components for Java framework deploys views, business rules, and custom code in components that clients can share. With the Business Components for Java framework, such components are easy to build and maintain, easy to use and reuse, and easy to customize. Components do not need modification to be deployed to any supported platform.

User Interface XML (UIX)

UIX (User Interface XML) is a set of technologies that constitute a framework for building Web applications. The main focus of UIX is the user presentation layer of an application, with additional functionality for managing events and for managing the state of the application flow. UIX is designed to create applications with page-based navigation, such as an online human resources application, rather than full-featured applications requiring advanced interaction, such as an integrated development environment (IDE).

The complete UIX Developer's Guide is included in the JDeveloper online help.

Oracle Reports

Oracle Reports Developer and Reports Server enable you to build and publish high-quality, dynamically generated Web reports. Each major task is expedited by the use of a wizard, while the use of report templates and a live data preview enables easy customizing of the report structure. Reports can be published throughout the enterprise through a standard Web browser, in any chosen format, including HTML, HTML Cascading Style Sheets (HTML CSS), Adobe's Portable Document Format (PDF), delimited text, Rich Text Format (RTF), PostScript, PCL, or XML. Reports can be integrated with Oracle Application Server (OracleAS) Portal.

You can schedule reports to run periodically and update the information in an Oracle Portal site. Reports can also be personalized for a user.

Oracle Reports Developer is part of Oracle's E-business intelligence solution and integrates with Oracle Discoverer and Oracle Express.

Information for Using the XDK

Here are topics about using the XDK:

Using Apache Web Server Instead of the Oracle9i Application Server

You can use the Apache Web server which must now interact with Oracle through JDBC or other means. You can use the XSQL servlet. This is a servlet that can run on any servlet-enabled Web server. This runs on Apache and connects to the Oracle database through a Java Database Connectivity (JDBC) driver.

Need for an XML Parser If all the XML Was Created By Programs

Whether you still need an XML parser if all XML was created by your programs depends on what you intend to do with the generated XML. If your task is just to generate XML and send it out then you might not need it. But if you wanted to generate an XML DOM tree then you need the Parser. You also need it if you have incoming XML documents and you want to parse and store them. See the XML SQL utility for some help on this issue.

Answer: No. The field description in the control file can be nested, which is part of the support for object relational columns. The data record to which this maps is, of course, flat but using all the data field description features of the SQL*Loader one can get a lot done. For example:

Keep in mind that the COLUMN OBJECT field names have to match the object column in the database. You will have to use a custom record terminator, otherwise it defaults to newline (that is, the newline separates data for a complete database record).

If your XML is more complex and you are trying to extract only select fields, you can use FILLER fields to reposition the scanning cursor, which scans from where it has left off toward the end of the record (or for the first field, from the beginning of the record).

The SQL*Loader has a very powerful text parser. You can use it for loading XML when the document is very big.

Information About Previous Oracle Releases

These sections concern previous Oracle releases.

Using Oracle Database Version 7 and XML

You can go a long way with Oracle database version 7. The only problem is that you cannot run any of the Java programs inside the server; that is, you cannot load all the XML tools into the server. But you can connect to the database by downloading the Oracle JDBC utility for Oracle database version 7 and run all the programs as client-side utilities.

Doing Data Transfers to Other Vendors Using XML from Oracle Release 7.3.4

Question: My company has Oracle release 7.3.4 and my group is thinking of using XML for some data transfers between us and our vendors. It looks as if we need to move to Oracle8i or higher in order to do so. Is there any way of leveraging Oracle release 7 to do XML?

Answer: As long as you have the appropriate JDBC 1.1 drivers for Oracle release 7.3.4 you can use the XML SQL Utility to extract data in XML.

For JDBC drivers, refer to the following Web site for information about Oracle database version 7 JDBC OCI and JDBC Thin Drivers:

http://otn.oracle.com/tech/java.101/

Using Versions Prior to Oracle8i and Oracle XML Tools?

If I am using an Oracle version earlier than Oracle8i, can I supply XML- based applications using Oracle XML tools? If yes, then what are the licensing terms?

The Oracle XDKs for Java, C, and C++ can work outside the database, including the XML SQL Utility and XSQL Pages framework. Licensing is the same, including free runtime. See Oracle Technology Network (OTN) for the latest licenses.

XML Standards That Oracle Supports

Here are discussions about XML standards that Oracle supports.

B2B Standards and Development Tools that Oracle Supports

What B2B XML standards (such as ebXML, cxml, and BizTalk) does Oracle support? What tools does Oracle offer to create B2B exchanges?

The Oracle Internet support provides an integrated and solid platform for B2B exchanges.

Oracle Corporation's Direction Regarding XML

Oracle Corporation's XML strategy is to use XML in ways that exploit all of the benefits of the current Oracle technology stack. Today you can combine Oracle XML components with the Oracle database and Streams to achieve conflict resolution, transaction verification, and so on. Oracle is working to make future releases more seamless for these functions, as well as for functions such as distributed two phase commit transactions.

The XMLType datatype is used for storing XML in a column in a table or view.

XML data is stored either in object-relational tables or views, or as CLOBs. XML transactions are transactions with one of these datatypes and are handled using the standard Oracle mechanisms, including rollback segments, locking, and logging.

Oracle is active in all XML standards initiatives, including W3C XML Working Groups, Java Extensions for XML, Open Applications Group, and XML.org for developing and registering specific XML schemas.

Oracle Corporation's Plans for XML Query

Oracle is participating in the W3C Working Group for XML Query. Oracle is considering plans to implement a language that enables querying XML data, such as in the XSQL proposal. While XSLT provides static XML transformation features, a query language will add data query flexibility similar to what SQL does for relational data.

Maximum XML File Sizes

Limitations on the Size of an XML File

There are no XML limitations to an XML file size except the limit of the operating system.

Size Limit for XML Documents Generated from the Database

Oracle is not aware of any limits beyond those imposed by the object view and the underlying table structure.

Maximum Size for an XML Document for PL/SQL

Is there a maximum size for an XML document to provide data for PL/SQL (or SQL) across tables, given that no CLOBs are used? The size limit for an XML document providing data for PL/SQL across tables should be what can be inserted into an object view.