Skip Headers

Oracle9i Application Developer's Guide - XML
Release 1 (9.0.1)

Part Number A88894-01
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

1
Oracle XML-Enabled Technology

This chapter describes the following sections:

What is XML ?

Appendix A, "An XML Primer", provides some introductory information about XML, the W3C XML recommendations, differences between HTML and XML, and other XML syntax topics. It also discusses reasons why XML, the internet standard for information exchange is such an appropriate and necessary language to use in database applications.

What are Oracle XML-Enabled Technologies?

XML models structured and semi-structured data. Oracle9i supports structured and semi-structured data, as well as complex and unstructured data. Oracle9i is XML-enabled in that it natively handles the storage, query, presentation, and manipulation of XML data.

Oracle XML Components

Figure 1-1 shows the Oracle XML components in the "XML application" box. Oracle XML components are comprised of the following:

Figure 1-1 also lists some typical XML-based business solutions:

Figure 1-1 Oracle XML Components and E-Business Solutions: What's Involved


Text description of adxml033.gif follows This takes you to Chapter 8, Searching XML Data with Oracle Text This takes you to Chapter 7, XML SQL Utility (XSU) This takes you to Part 7, XDK for Java Beans This takes you to Part 10, XDK for PL/SQL...Parser and XSLT for PL/SQL This takes you to Part 9, XDK for C++...Parser and XSLT for C++, XML Schema Processor for C++, Class Generator for C++ This takes you to Part 8, XDK for C...Parser and XSLT for C, XML Schema Processor for C This takes you to Part 6, XDK for Java...Parser and XSLT for Java, Class Generator for Java, Schema Processor for Java, XSQL Servlet, XSU This takes you to Chapter 16, How Oracle Exchange Uses XML This takes you to Part 9, XDK for C++...Parser and XSLT for C++, XML Schema Processor for C++, Class Generator for C++ This takes you to Chapter 18, Using Oracle9iAS Dynamic Services and XML This takes you to Chapter 5, Database Support for XML This takes you to Chapter 6, Database Uri-references
Text description of the illustration adxml033.gif

Figure 1-1 also shows the following:

Oracle Development Tools and Frameworks

XSQL Servlet and Pages, Oracle9i Internet File System (9iFS), JDeveloper, Business Components for Java (BC4J), Oracle Portal (WebDB), Oracle9iAS Reports Services, and Oracle9i Dynamic Services can all be used to build XML applications.


Note:

XSQL Servlet and Pages are part of the Oracle XDK for Java. 


Database and Middle Tier

XML applications can either reside on the database or on a middle tier, such as Oracle9i Application Server, Apache Server, or other Java enabled Web servers.

Data Stored in the Database

Data is stored as relational tables utilizing object views or as XML documents in XMLType columns and CLOBs. Oracle Text (interMedia Text) can be used to efficiently search XML documents stored in XMLType or CLOB columns.

Storing and Retrieving XML Data from Oracle9i

XML has emerged as the standard for data interchange on the Web and Oracle9i is XML-enabled to natively store, search, and retrieve XML in the following formats:

XML Support in the Database

Oracle9i provides the following XML support:

XML and URI Data Types

Oracle9i provides new types to handle XML and URI data. The Extensible Markup Language (XML) is a standard format developed by the World Wide Web Consortium (W3C) for representing structured and un-structured data on the Web.

URIs or Universal Resource Identifiers are used to identify resources such as web pages anywhere on the web. Oracle9i provides a new class of URIs to access data stored in the database itself, called DBUri-refs. It also provides a new set of types to store and access both external and internal URIs from the database.

XMLType

The Oracle supplied type, XMLType, can be used to store and query XML data in the database. XMLType provides member functions to access, extract and query the XML data using XPath expressions. XPath is another standard developed by the W3C committee to traverse XML documents. In Oracle9i, XMLType functions only support a limited subset of the XPath expressions. Oracle9i also provides a set of SQL functions such as SYS_XMLGEN,SYS_XMLAGG, and other PL/SQL packages (DBMS_XMLGEN) to create these XMLType values from existing relational or object relational data.

XMLType, a system defined type, can be used as arguments to functions or as table or view columns. When you create a XMLType column in a table Oracle internally uses a CLOB to actually store the XML data associated with this column. You can create Oracle Text indexing on the XMLType column and other functional indexes. In Oracle9i, since the XMLType is stored as a CLOB, updates can only be made to the entire document.

See Also:

 

URI Data Types

Oracle9i supplies the following family of Uri types:

These are related by an inheritance hierarchy. UriType is an abstract type and the DBUriType and HttpUriType are subtypes of this type.

Since UriType is the super type, you can create columns of this type and store DBUriType or HttpUriType instances in this column. This allows you to reference data stored inside or outside the database and access them consistently.

DBUri-ref uses an XPath like representation to reference data inside the database. If you imagine the database as a XML tree, then you would see the tables, rows and columns as elements in the XML document. For instance, user scott would see a tree such as:

  <SCOTT> 
    <EMP> 
      <ROW> 
        <EMPNO>2100</EMPNO> 
        <ENAME>John</ENAME> 
        <SALARY>10000</SALARY> 
        .. <!-- other columns --> 
      </ROW> 
      ... <!-- other rows --> 
    </EMP> 
    <!-- other tables..--> 
  </SCOTT> 
  <!-- other user schemas on which you have some privilege on..--> 

DBUri-ref is simply an XPath expression over this virtual XML document. So to reference the SALARY value in the EMP table for the employee with employee number 2100, you can write a DBUri-ref as:

/SCOTT/EMP/ROW[EMPNO=2100]/SALARY 

Using this, you can reference data stored in CLOBs or other columns and expose them as URLs to the external world. Oracle9i provides a standard servlet than can be installed and run under the Oracle Servlet engine which can interpret such URLs.

See Also:

Chapter 6, "Database Uri-references" 

Extensibility and XML

Oracle's extensibility enables special indexing on XML, including Oracle Text indexes for section searching, special operators to process XML, aggregation of XML, and special optimization of queries involving XML.

Oracle Text Searching

XML text stored in LOBs can be indexed using the extensibility indexing interface. Oracle9i provides operators such as CONTAINS and WITHIN that you can use to search within the XML text for substring matches.

See Also:

 

Oracle-Based XML Applications

There are many potential uses of XML in Internet applications. This manual focuses on the following two database-centric application areas where Oracle's XML components are well suited.

Content and Document Management

Content and document management includes customizing data presentation. These applications typically process mostly authored XML documents. Several case studies are described in the manual.

See:

Content and Document Management Chapters in Oracle9i Case Studies - XML Applications:

  • "Customizing Content with XML: Dynamic News Application"

  • "Oracle9i AS Wireless Edition and XML"

  • "Customizing Presentation with XML and XSQL: Flight Finder"

 

Business-to-Business (B2B) or Business-to-Consumer (B2C) Messaging

B2B and B2C messaging involves exchanging data between business applications. These applications typically process generated XML documents or a combination of generated and composed XML documents.

See:

These B2B Chapters:

The following chapters in the manual, Oracle9i Case Studies - XML Applications:

  • "Customizing Discoverer 4i Viewer with XSL"

  • "Service Delivery Platform (SDP) and XML"

  • "How Oracle Exchange Uses XML"

  • "B2B XML Application: Step by Step"

 

When to Use Oracle XML Components: How They Work Together

For descriptions of the Oracle XML components and how they work together see Chapter 2, "Modeling and Design Issues for Oracle XML Applications" and Chapter 3, "Oracle XML Developer Kits (XDKs) and Components: Overview and General FAQs".

The remaining sections of this manual, describe how to use the Oracle XML components, Oracle development tools, and how to build Web-based, database applications with these tools.

Oracle XML-Enabled Technology Components and Features

Oracle9i is well-suited for building XML database applications. Oracle XML-enabled technology has the following features:

Indexing and Searching XML Documents with Oracle Text (interMedia Text)

Oracle Text (interMedia Text) provides powerful search and retrieval options for XML stored in CLOBs and other documents. It can index and search XML documents and document sections as large as 4 Gigabytes each stored in a column in a table.

Oracle Text XML document searches include hierarchical element containership, doctype discrimination, and searching on XML attributes. These XML document searches can be used in combination with standard SQL query predicates or with other powerful lexical and full-text searching options.

XML documents or document sections saved into text CLOBs in the database can be enabled for indexing by Oracle Text's text-search engine. Developers can pinpoint searches to data within a specific XML hierarchy as well as locate name-value pairs in attributes of XML elements.

Since Oracle Text is seamlessly integrated into the database and the SQL language, developers can easily use SQL to perform queries that involve both structured data and indexed document sections.

See Also:

 

Messaging Hubs and Middle Tier Components

Also included in Oracle XML are the following components:

Oracle JVM (Java Virtual Machine)

Built from the ground up on Oracle Multi-threaded Server (MTS) architecture, Oracle JVM (Jserver) is a Java 1.2 compliant virtual machine that data server shares memory address space. This allows the following:

Oracle JVM supports native CORBA and EJB standards as well as Java Stored Procedures for easy integration of Java with SQL and PL/SQL.

Oracle9i Application Server

Oracle9i Application Server (Oracle9iAS), offers services for both intranet and internet Web applications. It is integrated with Oracle9i and offers advanced services such as data caching and Oracle Portal. Oracle9iAS also provides other services including Oracle Advanced Queueing, Oracle Message Broker, Oracle Workflow, Oracle9i Reports Services, Dynamic Services, and more.

See Also:

http://otn.oracle.com/products/ 

Back-End to Database to Front-End Integration Issues

A key development challenge is integrating back-end ERP and CRM systems from multiple vendors, with systems from partners in their supply chain, and with customized data warehouses.

Such data exchange between different vendors' relational and object-relational databases is simpler using XML. One example of a data exchange implementation using XML and AQ is provided in Oracle9i Case Studies - XML Applications, "Building a B2B Application Using XML and AQ".

Oracle XML Technology and Oracle XML-enabled tools, interfaces, and servers provide building blocks for most data and application integration challenges.

Higher Performance Implications

Not only are these building blocks available, but their use results in higher performance implementations for the following reasons:

Hence developers can build XML-based Web solutions that integrate Java and database data and facilities in many ways.

Oracle XDKs Provide the Two Most Common APIs: DOM and SAX

Oracle XDKs are implemented in four languages, Java, C, C++, and PL/SQL. The Java version runs directly on Oracle JVM (Java virtual machine). It supports the XML 1.0 specification and is used as a validating or non-validating parser.

The parser provides the two most common APIs that developers need for processing XML documents:

For more information, see Chapter 20, "Using XML Parser for Java"". See Appendix B, "Comparing Oracle XML Parsers and Class Generators by Language", for a comparison of the Oracle XML parsers and generators.

Writing Custom XML Applications

Writing custom applications that process XML documents can be simpler in an Oracle9i environment. This enables you to write portable standards-based applications and components in your language of choice that can be deployed on any tier.

The XML parser is part of the Oracle9i platform on every operating system where Oracle9i is ported.

Oracle XML Parser is also implemented in PL/SQL. Existing PL/SQL applications can be extended to take advantage of Oracle XML technology.

The Oracle Suite of Integrated Tools and Components

Oracle9i provides an integrated suite of tools and components for building e-business applications:

This suite of tools ensure that exchanging data and document objects is simplified for application development and that multiple serializations is eliminated.

Oracle JDeveloper and Oracle Business Components for Java (BC4J)

Oracle JDeveloper is an integrated environment for building, deploying, and debugging applications leveraging Java and XML on Oracle9i. It facilitates working in Java 1.1 or 1.2 with CORBA, EJB, and Java Stored Procedures. With it you can do the following:

Examples of applications built using Oracle JDeveloper include:

See Chapter 11, "Using JDeveloper to Build Oracle XML Applications" for more information on JDeveloper and XML applications.

Oracle Business Components for Java (BC4J)

Business Components for Java (BC4J) is an Oracle9i application framework for encapsulating business logic into reusable libraries of Java components and reusing the business logic through flexible, SQL-based views of information.


Note:

Oracle JDeveloper and BC4J are not included with Oracle9i. Only the BC4J runtime is included. You can download JDeveloper from OTN. 


Oracle9i Internet File System (Oracle 9iFS or 9iFS)

Access to Oracle9i Internet File System (9iFS) facilitates organizing and accessing documents and data using a file- and folder-based model through standard Windows and Internet protocols such as SMB, HTTP, FTP, SMTP, and IMAP4.

9iFs facilitates building and administering Web-based applications. It is an application interface for Java and can load a document, such as a Powerpoint file, into Oracle9i and display the document from a Web server, such as Oracle9i Application Server or Apache Web Server.

See Also:

Oracle9i Case Studies - XML Applications, the chapter, "Using Internet File System (iFS) to Build XML Applications" 

9iFS is a simple way for developers to work with XML, where iFS serves as the repository for XML. 9iFS automatically parses XML and stores content in tables and columns. 9iFS renders the content when a file is requested delivering select information, for example, on the Web.

For more information see http://otn.oracle.com/products/ifs/

Oracle Portal

Oracle Portal can, for example, input XML-based Rich Site Summary (RSS) format documents, and merge the information with an XSL stylesheet. The result can be rendered in a browser. This design efficiently separates the rendition of information from the information itself and allows for easy customization of the look and feel without risk to data integrity.

Oracle Portal is software for building and deploying enterprise portals, the Web sites that power an e-business. The browser interface delivers an organized, personalized view of business information, Web content, and applications needed by each user. It includes site-building and self-service Web publishing functionality of WebDB 2.2 and adds new enterprise portal features such as single sign-on, personalization, and content classification. Oracle Portal uses Oracle9i and is deployed on and packaged with Oracle9i Application Server.

Portlets:

Portlets are reusable interface components that provide access to Web-based resources. Any Web page, application, business intelligence report, syndicated content feed, hosted software service or other resource can be accessed through a portlet, allowing it to be personalized and managed as a service of Oracle Portal. Companies can create their own portlets and select portlets from third-party portlet providers. Oracle provides a Portal Developer's Kit (PDK) for developers to easily create portlets using PL/SQL, Java, HTML, or XML.

See Also:

Chapter 15, "Using the PDK for Visualizing XML Data in Oracle Portal" for an introduction to Oracle Portal's PDF and URL Services. 

Oracle Exchange

The Oracle Exchange platform is based on Oracle9i. It offers all necessary business transactions to support an entire industry's or a company's supply chain. Oracle Exchange is based on Oracle's e-Business Suite, which supports a supply chain from the initial contact with the prospect, to manufacturing planning and execution, to post-sales ongoing service and support.

Oracle Exchange uses XML as its data exchange format and message payload, and Advanced Queueing.

See Also:

Chapter 16, "How Oracle Exchange Uses XML" 

XML Gateway

XML Gateway is a set of services that allow you to easily integrate with the Oracle e-Business Suite, to create and consume XML messages triggered by business events. It also integrates with Oracle Advanced Queuing to enqueue/dequeue messages which are then transmitted to/from business partners through any message transport service, including Oracle Message Broker.

See Also:

Chapter 17, "Introducing Oracle XML Gateway" 

Metadata API

Metadata API provides a centralized, simple, and flexible means for performing the following tasks:

Metadata API is available on Oracle9i whenever the instance is operational. It is not available on Oracle Lite.

See Also:

Chapter 13, "Using Metadata API" 

Other XML Initiatives

Besides these tools, the following initiatives are underway.

XML Metadata Interchange (XMI): Managing and Sharing Tools and Data Warehouse Metadata

Support for XML Metadata Interchange (XMI) specification proposed by Oracle, IBM, and Unisys. This enables application development tools and data warehousing tools from Oracle and others to exchange common metadata, ensuring that you can choose any tool without having to modify your application and warehouse design.

Advanced Queueing XML Support: Using the Internet for Reliable, Asynchronous Messaging

Oracle Advanced Queueing (AQ) now allows reliable propagation of asynchronous messages, including messages with XML documents, document sections, or even fragments as their payload, over secure HTTP. This enables dynamic trading and eliminates delays and startup costs to establish inter-company or inter-agency links.

See Also:

Chapter 9, "Exchanging XML Data Using Oracle AQ" 

Oracle XML Samples and Demos

This manual contains examples that illustrate the use of Oracle XML components. The examples do not conform to one schema. Where examples are available for download or supplied with the $ORACLE_HOME/rdbms/demo or $ORACLE_HOME/xdk/.../sample, this is indicated.

What Is Needed to Run Oracle XML Components

Oracle8i and higher includes native support for internet standards, including Java and XML. You can run Oracle XML components and applications built with them inside the database itself using Oracle JServer, a built-in Java Virtual Machine.

Use Oracle Lite to store and retrieve XML data, for devices and applications that require a smaller database footprint.

Oracle XML components can be downloaded for free from http://otn.oracle.com/tech/xml

Requirements for XDK

The following are requirements for XDK for Java and XDK for PL/SQL:

Requirements are also discussed in the XDK chapters, chapters 19 through 29, and Appendixes C though G.

Which XML Components are Included with Oracle9i Database and Oracle9i Application Server?

Table 1-1 lists the XDK component versions included with Oracle9i Database and Oracle9i Application Server (Oracle9iAS):

Table 1-1 Oracle9i and Oracle9iAS XDK Component Supplied Versions 
XDK Component  Oracle9i Database Rel. 1(9.0.1)   Oracle9iAS Rel.--prellimary version nos. only 

XDK for Java 

 

 

XML Parser for Java and XSLT Processor 

9.0.1.0.0 

9.0.1.0.0 

XML Schema Processor for Java 

9.0.1.0.0 

9.0.1.0.0 

XML Class Generator for Java 

9.0.1.0.0 

9.0.1.0.0 

XSQL Servlet 

9.0.1.0.0 

9.0.1.0.0 

XML SQL Utility (XSU) for Java 

9.0.1.0.0 

9.0.1.0.0 

XDK for Java Beans 

 

 

XML Transviewer Beans 

9.0.1.0.0  

9.0.1.0.0  

XDK for C 

 

 

XML Parser for C and XSLT Processor 

9.0.1.0.0 

9.0.1.0.0 

XML Schema Processor for C 

9.0.1.0.0 

9.0.1.0.0 

XDK for C++ 

 

 

XML Parser for C++ and XSLT Processor 

9.0.1.0.0 

9.0.1.0.0 

XML Schema Processor for C++ 

9.0.1.0.0 

9.0.1.0.0 

XML Class Generator for C++ 

9.0.1.0.0 

9.0.1.0.0 

XDK for PL/SQL 

 

 

XML Parser for PL/SQL and XSLT Processor 

9.0.1.0.0 

9.0.1.0.0 

XML SQL Utility (XSU) for PL/SQL 

9.0.1.0.0 

9.0.1.0.0 

XML Technical Support

Besides your regular channels of support through your customer representative or consultant, technical support for Oracle XML-enabled techologies is available free through the Discussions option on Oracle Technology Network (OTN):

You do not need to be a registered user of OTN to post or reply to XML-related questions on the OTN technical discussion forum. To use the OTN technical forum follow these steps:

  1. In the left-hand navigation bar, of the OTN site select Support > Discussions.

  2. Click on Enter a Technical Forum.

  3. Scroll down to the Technologies section. Select XML.

  4. Post any questions, comments, requests, or bug reports there.

Download the Latest Software From OTN

You will find the latest information about the Oracle XML components and can download them from OTN:

At the top, under Download Oracle Products, Drivers, and Utilities, in the Select a Utility or Driver pull down menu, scroll down and select any of the XML utilities listed. For the latest XML Parser for Java and C++, select v2.


Go to previous page Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index