Skip Headers

Oracle9i XML Developer's Kits Guide - XDK
Release 2 (9.2)

Part Number A96621-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

1
Overview of XML Developer's Kits and Components

This chapter contains the following sections:

Oracle XML Components: Overview

Oracle9i provides several components, utilities, and interfaces you can use to take advantage of XML technology in building your Web-based database applications. Which components you use depends on your application requirements, programming preferences, development, and deployment environments.

Starting with XDK 9.0.2 (shipped with iAS v2) and XDK 9.2 (shipped with Oracle9i Release 2), XSLStylesheet is thread-safe and can be used across threads in multiple XSLProcessor.processXSL calls. But XSLProcessor, a light-weight object, will not be made thread safe.

The following XML components are provided with Oracle9i and Oracle9i Application Server:

The following figures schematically illustrate how the XDK components can be used to generate XML:

Development Tools and Other XML-Enabled Oracle9i Features

The following list includes Oracle's XML-enabled development tools:

Oracle Text: A querying, search and retrieval tool.

Oracle JDeveloper9i and BC4J: JDeveloper9i is an integrated development tool for building Java web-based applications. Oracle Business Components for Java (BC4J) is a Java, XML-powered framework that enables productive development, portable deployment, and flexible customizing of multitier, database-savvy applications from reusable business components. These applications can be deployed as CORBA Server Objects or EJB Session Beans on enterprise-scale server platforms supporting Java technology.

See Also:

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

Text description of adxml033.gif follows
Text description of the illustration adxml033.gif


XDK for Java

XDK for Java is composed of the following components:

XDK for JavaBeans

XDK for JavaBeans is composed of the following component:

XDK for C

XDK for C is composed of the following component:

XDK for C++

XDK for C++ is composed of the following:

XDK for PL/SQL

XDK for PL/SQL is composed of the following:

XML Parsers

The Oracle XML parser includes implementations in C, C++, PL/SQL, and Java for the full range of platforms on which Oracle9i runs.

Based on conformance tests, xml.com ranked the Oracle parser in the top two validating parsers for its conformance to the XML 1.0 specification, including support for both SAX and DOM interfaces. The SAX and DOM interfaces conform to the W3C recommendations 2.0.

Version 2 (v2) of the Oracle XML parser provides integrated support for the following features:

The parsers are available on all Oracle platforms.

Figure 1-2 illustrates the Oracle XML Parser for Java. Figure 1-3 illustrates the Oracle XML parsers' overall functionality.

See Also:

Chapter 4, "XML Parser for Java" and Chapter A, "XDK for Java: Specifications and Quick References".

Figure 1-2 Oracle XML Parser for Java

Text description of adxml002.gif follows
Text description of the illustration adxml002.gif


Figure 1-3 The XML Parsers: Java, C, C++, PL/SQL

Text description of adxml001.gif follows
Text description of the illustration adxml001.gif


XSL Transformation (XSLT) Processor

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

The Oracle XML Parsers, Version 2 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, HTML, or virtually any other text-based format.

How to use the XSLT Processor is described in Chapter 4, "XML Parser for Java".

See Also:

Chapter A, "XDK for Java: Specifications and Quick References".

XML Class Generator

XML Class Generator creates a set of Java or C++ classes for creation of XML documents corresponding to an input DTD or XML Schema. Figure 1-4 shows Oracle XML Class Generator functionality.

How to use the XML Class Generators is described in the following chapters:

Figure 1-4 Oracle XML Java Class Generator

Text description of adxml003.gif follows
Text description of the illustration adxml003.gif


XML Transviewer JavaBeans

Oracle XML Transviewer JavaBeans are a set of XML components that constitute XML for JavaBeans. These are used for Java applications or applets to view and transform XML documents.

They are visual and non-visual Java components that are integrated into Oracle JDeveloper to enable the fast creation and deployment of XML-based database applications. In this release, the following beans are available:

As standard JavaBeans, they can be used in any graphical Java development environment, such as Oracle JDeveloper. The Oracle XML Transviewer Beans functionality is described in Chapter 10, "XDK JavaBeans".

Oracle XSQL Page Processor and Servlet

XSQL Servlet is a tool that processes SQL queries and outputs the result set as XML. This processor is implemented as a Java servlet and takes as its input an XML file containing embedded SQL queries. It uses XML Parser for Java, XML- SQL Utility, and Oracle XSL Transformation (XSLT) Engine to perform many of its operations.

You can use XSQL Servlet to perform the following tasks:

Servlet Engines That Support XSQL Servlet

XSQL Servlet has been tested with the following servlet engines:

JavaServer Pages Platforms That Support XSQL Servlet

JavaServer Pages can use <jsp:forward> or <jsp:include> to collaborate with XSQL Pages as part of an application. The following JSP platforms have been tested to support XSQL Servlet:

In general, it should work with the following:

XSQL Servlet is a tool that processes SQL queries and outputs the result set as XML. This processor is implemented as a Java servlet and takes as its input an XML file containing embedded SQL queries. It uses XML Parser for Java and XML SQL Utility to perform many of its operations.

Figure 1-5 shows how data flows from a client, to the servlet, and back to the client. The sequence of events is as follows:

  1. The user enters a URL through a browser, which is interpreted and passed to the XSQL Servlet through a Java Web Server. The URL contains the name of the target XSQL file (.xsql) and optionally, parameters, such as values and an XSL stylesheet name. Alternatively, the user can invoke the XSQL Servlet from the command line, bypassing the browser and Java web server.
  2. The servlet passes the XSQL file to the XML Parser for Java, which parses the XML and creates an API for accessing the XML contents.
  3. The page processor component of the servlet uses the API to pass XML parameters and SQL statements (found between <query></query> tags) to XML SQL Utility. The page processor also passes any XSL processing statements to the XSLT Processor.
  4. XML SQL Utility sends the SQL queries to the underlying Oracle9i database, which returns the query results to the utility.
  5. XML SQL Utility returns the query results to the XSLT Processor as XML formatted text. Results are embedded in the XML file in the same location as the original <query> tags.
  6. If desired, the query results and any other XML data are transformed by the XSLT processor using a specified XSL stylesheet. The data can be transformed to HTML or any other format defined by the stylesheet. The XSLT processor can selectively apply different stylesheets based on the type of client that made the original URL request. This HTTP_USER_AGENT information is obtained from the client through an HTTP request.
  7. The XSLT Processor passes the completed document back to the client browser for presentation to the user.

    See Also:

    Chapter 9, "XSQL Pages Publishing Framework"

Figure 1-5 Oracle XSQL Page Processor and Servlet Functional Diagram

Text description of adxml017.gif follows
Text description of the illustration adxml017.gif


Oracle XML SQL Utility (XSU)

Oracle XML SQL Utility (XSU) supports Java and PL/SQL.

Figure 1-6 shows the Oracle XML SQL Utility overall functionality.

Figure 1-6 Oracle XML SQL Utility Functional Diagram

Text description of adxml012.gif follows
Text description of the illustration adxml012.gif


XML SQL Utility for Java consists of a set of Java classes that perform the following tasks:

Generating XML from Query Results

Figure 1-7 shows how XML SQL Utility processes SQL queries and returns the results as an XML document.

Figure 1-7 XMl-SQL Utility Processes SQL Queries and Returns the Result as an XML Document

Text description of adxml004.gif follows
Text description of the illustration adxml004.gif


XML Document Structure: Columns Are Mapped to Elements

The structure of the resulting XML document is based on the internal structure of the database schema that returns the query results:

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

The XML SQL Utility (XSU) generates either of the following:

XSU Generates a DTD Based on Queried Table's Schema

You can also use the XML SQL Utility (XSU) to generate a DTD based on the schema of the underlying table or view being queried. You can use the generated DTD as input to the XML Class Generator for Java or C++. 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. See also "XML Class Generator".

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.

See Also:

Chapter 8, "XML SQL Utility (XSU)" and Oracle9i XML Case Studies and Applications, the chapter, "B2B XML Application: Step by Step", for more information about this approach.


Note:

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 8, "XML SQL Utility (XSU)".


TransX Utility

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 take advantage of easy data transfer from XML to the database, a simple data format that is intuitive for both developers and translators, and validation capability that is less error prone than previous techniques.

See Also:

Chapter 12, "Oracle TransX Utility"

Oracle Text

Oracle Text extends Oracle9i by indexing any text or documents stored in Oracle9i. Use Oracle Text to perform searches on XML documents stored in Oracle9i by indexing the XML as plain text, or as document sections for more precise searches, such as find Oracle WITHIN title where title is a section of the document.

See Also:

For more information on using Oracle Text and XML, see:

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 Advanced Queuing to enqueue/dequeue a message which is then transmitted to/from the business partner through any message transport agent.

See Also:

Oracle XML Components: Generating XML Documents

Figure 1-8 through Figure 1-11 illustrate the relationship of the Oracle XML components and how they work together to generate XML documents from Oracle9i through a SQL query. The options are depicted according to language used:

Using Oracle XML Components to Generate XML Documents: Java

Figure 1-8 shows the Oracle XML Java components and how they can be used to generate an XML document. Available XML Java components are:

In the Java environment, when a user or client or application sends a query (SQL), there are three possible ways of processing the query using the Oracle XML components:

Regardless of which way the stored XML data is generated from the database, the resulting XML document output from the XML Parser is further processed, depending on what you or your application needs it for.

The XML document is formatted and customized by applying stylesheets and processed by the XSLT.

Figure 1-8 Generating XML Documents Using XDK for Java

Text description of adxml006.gif follows
Text description of the illustration adxml006.gif


Using Oracle XML Components to Generate XML Documents: C

Figure 1-9 shows the Oracle XML C language components used to generate an XML document. The XML components are:

SQL queries can be sent to the database by OCI or as embedded statements in the Pro*C/C++ precompiler.

The resulting XML data can be processed in the following ways:

This XML data is optionally transformed by the XSLT processor, viewed directly by an XML-enabled browser, or sent for further processing to an application or AQ Broker.

Figure 1-9 Generating XML Documents Using XDK for C

Text description of adxml029.gif follows
Text description of the illustration adxml029.gif


Using Oracle XML Components to Generate XML Documents: C++

Figure 1-10 shows the Oracle XML components used to generate an XML document. The XDK for C++ components used here are:

In the C++ environment, when a user or client or application sends a SQL query, there are two possible ways of processing the query using the XDK for C++:

Figure 1-10 Generating XML Documents Using XDK for C++

Text description of adxml030.gif follows
Text description of the illustration adxml030.gif


Using Oracle XML Components to Generate XML Documents: PL/SQL

Figure 1-11 shows the XDK for PL/SQL components used to generate an XML document:

In the PL/SQL environment, when a user or client or application sends a SQL query, there are two possible ways of processing the query using the Oracle XML components:

Figure 1-11 Generating XML Documents Using XDK for PL/SQL

Text description of adxml028.gif follows
Text description of the illustration adxml028.gif


Frequently Asked Questions (FAQs): Oracle XML-Enabled Technology

This section includes general questions about Oracle XML-enabled technology in the following categories:

There are Frequently Asked Questions at the end of several other chapters in this manual.

Frequently Asked Questions About the XDK

What XML Components Do I Need to Install?

I am going to develop a small application using XML and Oracle. Here is the scenario: Company A has is a central purchasing system with Departments B, C, and D. Company A gets purchase orders in XML format from B, C, and D.

Company A needs to collect all purchase orders and store them in an Oracle database. Then, it has to create another request for proposal for its preferred vendors in XML. I am writing queries to insert or update into the database. What XML components do I need to install in Oracle?

Answer: Assuming you are using Java, you need the XML Parser and XML SQL Utility. If you are using a Java-based front end to generate the purchase orders, then the XML Class Generator can provide you with the classes you need to populate your purchase orders. Finally, the XSQL Servlet can help you build a Web interface.

What Software Is Needed to Build an XML Application?

I have a CGI, Perl, and Oracle7 application on SolarisTM Operating Environment 2.6 and I want to convert it to an XML/XSL, Java, and Oracle application. I know most parts of the technologies, for example, SGML, XML, and Java, but I don't know how to start it in Oracle. What software do I need from Oracle? Specifically,

  1. Can I use Apache instead of the Oracle Web server? If so, how?
  2. How far can I go with Oracle 7.3?
  3. Do I still need an XML parser if all XML was created by my programs?
  4. What should be between the Web server and Oracle DB server? XSQL Servlet? A parser? Java VM? EJB? CORBA? SQLJ? JDBC? Oracle packages such as UTL_HTTP?

Answer:

  1. Yes you can. The Apache Web server 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 JDBC driver.
  2. You can go a long way with Oracle 7.3. The only problem would be 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 Oracle7 and run all the programs as client-side utilities.
  3. 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 would need the parser. You would 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.
  4. As in the first part of this answer, you would need to have a servlet (or CGI) that interacts with Oracle through OCI or JDBC.

XML Questions

My project requires converting master-details data to XML for clients.

  1. What is the best way to design tables and generate XML flat tables, objects, or collections?
  2. Can I use XML SQL Utilities in Pro*C/C++?
  3. Is there a limiting size for generating XML documents from database?

Answer:

  1. It really depends on what your application calls for. The generalized approach is to use object views and have the schema define the tag structure with database data as the element content.
  2. Yes.
  3. We are not aware of any limits beyond those imposed by the object view and the underlying table structure.

Are There XDK Utilities That Translate Data from Other Formats to XML?

I know that the XSLT will translate from XML to XML, HTML, or another text-based format. What about the other way around?

Answer: For HTML, you can use utilities like Tidy or JTidy to turn HTML into well-formed HTML that can be transformed using XSLT. For unstructured text formats, you can try utilities like XFlat at the following Web site:

http://www.unidex.com/xflat.htm.

Can Oracle Generate a Database Schema from a Rational Rose Generated XML File?

Is it possible to generate a database schema in Oracle using a script with CREATE TABLE, from an XML file generated by a Rational Rose design tool?

Answer: All the parser and generator files (such as petal files, XML, and so on) are developed in our project. All the components are designed for reuse, but developed in the context of a larger framework. You have to follow some guidelines, such as modeling in UML, and you must use the base class to get any benefit from our work.

Oracle only generates object types and delivers full object-oriented features such as inheritance in the persistence layer. If you do not need this, the Rational Rose petal file parser and Oracle packages, as the base of the various generators, may interest you.

Does Oracle Offer Any Tools to Create and Edit XML Documents?

Does Oracle have any tools for creating XML documents based on DTDs or the XML schema definition DOM, or for editing XML documents with DTD or schema validation?

Answer: JDeveloper9i 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.

See Also:

Chapter 21, "XSLT Processor for PL/SQL"

How Can I Format XML Documents as PDF?

I have been asked to take stored XML docs in release 8.1.6 and format them as PDF. We are using JDeveloper release 3.1.1.2 as our development environment and the client wants to stick to OAS 4082 on Windows NT if possible. Any suggestions or recommended resources?

Answer: Oracle XSQL Pages release 1.0.2 supports integration with Apache FOP 0.14.0 for rendering PDF output from XML or SQL input.

It is possible to format XML into PDF using Formatting Object (FOP). See information on this at the following Web sites:

http://xml.apache.org/fop/

http://www.xml.com/pub/rg/75)

How Do I Load a Large XML Document into the Database?

I have a large (27 MB) data-centric XML document. I could not load it into the database when it was split into relational tables with the XML SQL utility, because the DOM parser failed due to a memory leak during the XSLT processor execution. Do you have a work-around for this problem? Should I use the SAX parser? How do I use the XSLT processor and the Sax parser?

Answer: If this is a one time load, or if the XML document always has the same tags, then you might consider using the SQL*Loader (direct path). All you have to do is compose a loader control file. See the Oracle9i Database Utilities manual, Chapter 3, for examples. You can use the enclosed by option to describe the fields. For example, in the files list, enter something like the following:

(empno    number(10)    enclosed by "<empno>" and "</empno>",...)

Except for the data parsing, which has to be done the same regardless of what you are using, the actual loading into the database will be fastest with SQL*Loader, as the direct path writes data straight to data blocks, bypassing the layers in between.

If the document is 27 MB because it is a very large number of repeating sub-documents, then you can use the sample code that comes in Chapter 14, of the book Building Oracle XML Applications by Steve Muench (O'Reilly) to load XML of any size into any number of tables. In this chapter, called "Advanced XML Loading Techniques," the example builds an XML Loader utility that does what you are looking for.

Can SQL*Loader Support Nesting?

If you have the following scenario:

...
     <something>
        <price>10.00</price>
     </something>
...
   ...
      ...
          <somethingelse>
            <price>55.00</price>
          </somethingelse>

Is there a way to uniquely identify the two <price> elements?

Answer: Not really. 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:

sample.xml

<resultset>
    <emp>
        <first>...</first>
        <last>...</last>
        <middle>....</middle>
    <emp>
    <friend>
        <first>...</first>
        <last>...</last>
        <middle>....</middle>
    </friend>
</resultset>

sample.ctl -- field definition part of the SQL Loader control file

field list ....
(
 emp  COLUMN OBJECT ....
   (
        first      char(30)   enclosed by "<first>" and "</first>",
        last      char(30)   enclosed by "<last>" and "</last>",
        middle     char(30)   enclosed by "<middle>" and </middle>"
   )
    friend COLUMN OBJECT ....
  (
        first      char(30)   enclosed by "<first>" and "</first>",
        last      char(30)   enclosed by "<last>" and "</last>",
        middle     char(30)   enclosed by "<middle>" and </middle>"
  )

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.

Frequently Asked Questions About Previous Oracle Releases

Can I Use Parsers from Different Vendors?

I am currently investigating SAX. I understand that both the Oracle and IBM parsers use DOM and SAX from W3C.

Answer: You will not have to change your code if you stick to SAX interfaces or DOM interfaces for your implementation. That is what the standard interfaces are in place to assist you with.

Is There XML Support in Oracle Release 8.0.6?

We are currently architecting some of our future systems to run on XML-based interfaces. Our current systems are all running Oracle release 8.0.6, and we would like to have some of our XML concepts implemented on the existing systems due to high demand. Are there current or future plans to support XML-based code within the database, or are there any adapters or cartridges that we can use to get by?

Answer: All of our XML Developer's Kit components, including the XML Parser, XSLT Processor, XSQL Servlet, and utilities like the XML SQL Utility all work outside the database against Oracle 8.0.6. However, you will not be able to run XML components inside the database or use Oracle Text XML searching, which are both features in Oracle8i and higher.

Can I Do Data Transfers to Other Vendors Using XML from Oracle Release 7.3.4?

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. From what I could see from this Web site, it looks like we would 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 should be able to use the XML SQL Utility to extract data in XML.

For JDBC drivers, refer to the following Web site for information about Oracle7 JDBC OCI and JDBC Thin Drivers:

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

If I Use Versions Prior to Oracle8i Can I Use 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?

Answer: 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 OTN for the latest licenses.

Can I Create Magnetic Tape Files with Oracle XML?

Is Oracle XML technology suitable for creating magnetic tape files where the file is just a string of characters like 'abcdefg........' in a particular format? Is it is possible to create a stylesheet that will create these kind of files?

Answer:

Yes. Just use <xsl:output method="text"/> to output plain text.

Frequently Asked Questions About Browsers that Support XML

Which Browsers Support XML?

Answer: The following browsers support the display of XML:

Frequently Asked Questions About XML Standards

Are There Advantages of XML Over EDI?

We are considering implementing EDI to communicate requirements with our vendors and customers. I understand that XML is a cheaper alternative for smaller companies. Do you have any information on the advantages of XML over EDI?

Answer: Here are some thoughts on the subject:

The next question then becomes: is XML going to replace EDI? Probably not. The technologies will likely coexist, at least for a while. Large companies with an existing investment in EDI will probably use XML as a way to extend their EDI implementation, which raises a new question of XML and EDI integration.

XML is a compelling approach for smaller organizations, and for applications where EDI is inflexible.

What B2B Standards and Development Tools Does Oracle Support?

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

Answer: Oracle participates in several B2B standards organizations:

For B2B exchanges, Oracle provides several alternatives depending on customer needs, such as the following:

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

What Is Oracle Corporation's Direction Regarding XML?

Answer: 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 Oracle8i (or higher) database and Advanced Queueing (AQ) 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.

XML data is stored either 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.

From Oracle9i, Oracle supports sending XML payloads using AQ. This involves making XML queriable from SQL.

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.

What Is Oracle Corporation's Plans for XML Query?

Answer: 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 XQL proposal. While XSLT provides static XML transformation features, a query language will add data query flexibility similar to what SQL does for relational data.

Oracle has representatives participating actively in the following 3C Working Groups related to XML and XSL: XML Schema, XML Query, XSL, XLink/XPointer, XML Infoset, DOM, and XML Core.

Are There Standard DTDs That We Can Use for Orders, Shipments, and So On?

We have implemented Oracle8i and the XDK. Where can we find basic, standard DTDs to build on for orders, shipments, and acknowledgements?

Answer: A good place to start would be this Web site, which has been set up for that purpose:

http://www.xml.org

Frequently Asked Questions About XML, CLOBs, and BLOBs

Is There Support for XML Messages in BLOBs?

Is there any support for XML messages enclosing BLOBs, or I should do it on an application level by encoding my binary objects in a suitable text format such as UUENCODE with a MIME wrapper?

Answer: XML requires all characters to be interpreted, therefore there is no provision for including raw binary data in an XML document. That being said, you can UUENCODE the data and include it in a CDATA section. The limitation on the encoding technique is to be sure it only produces legal characters for a CDATA section.

Frequently Asked Questions About Maximum File Sizes

What Is the Maximum XML File Size When Stored in CLOBs?

If we store XML files as CLOBs in the Oracle database, what is the maximum file size?

Answer: The maximum file size is 2 GB. See the Oracle9i Application Developer's Guide - Large Objects (LOBs) for more information on LOBs and CLOBs. For sample code, see:

http://otn.oracle.com/tech/java/sqlj_jdbc/index2.htm?Code&files/advanced/advanced.htm

Are There Any Limitations on the Size of an XML File?

Answer: There are no XML limitations to an XML file size.

What Is the Maximum Size for an XML Document?

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?

Also, what is the maximum size of XML document generated from Oracle to an XML document?

Answer:

The size limit for an XML document providing data for PL/SQL across tables should be what can be inserted into an object view.

The size limit for an XML document generated from Oracle to an XML document should be what can be retrieved from an object view.

Frequently Asked Questions About Inserting XML Data into Tables

What Do I Need to Insert Data Into Tables Using XML?

To select data for display and insert data to tables by XML what software do I need? We are using Oracle8i on SolarisTM Operating Environment.

Answer: You need the following software:

The first three can be obtained from Oracle. The fourth can be obtained from Sun Microsystems. If you want to perform the tasks from a browser, you will also need the following:

Frequently Asked Questions About XML Performance in the Database

Where Can I Find Information About the Performance of XML and Oracle?

Is there a whitepaper that discusses the performance of XML and Oracle?

Answer: Currently, we do not have any official performance analyses due to the lack of a performance standard or benchmark for XML products.

How Can I Speed Up the Record Retrieval in XML Documents?

I have a database with millions of records. I give a query based on some 4/5 parameters, and retrieve the records corresponding to that. I have added indexes in the database for faster retrieval of the same, but since the number of records returned is quite high and I planned to put a Previous and Next link to show only 10 records at a time, I had to get the count(*) of the number of records that match.

Since there are so many records, and count(*) does not consider the indexes, it takes nearly 30 seconds for the retrieved list to be seen on the browser window. If I remove that count(*), the retrieval is quite fast, but then there is no Previous and Next as I had linked them to count(*).

Answer: I presume you are referring to finding a faster way to retrieve XML documents. The solution is to use the SAX interface instead of DOM.

Make sure to select the COUNT(*) of an indexed column (the more selective the index the better). This way the optimizer can satisfy the count query with a few I/Os of the index blocks instead of a full-table scan.

Frequently Asked Questions About Multiple National Languages

How Do I Put Information in Chinese into XML?

My application requires communication with outside entities that may have a totally different language system. If I need to put information in other languages (for instance, Chinese) into XML, do I need to treat and process them differently? For example, do I need to know which encoding they use, or would the parser be able to recognize it? Would there be any problems when dealing with the database?

Answer: XML inherently supports multiple languages in a single document. Each entity can use a different encoding from the others; that is, you can add a Chinese entity encoded in a Chinese encoding to the rest of the document. You can also treat all portions uniformly, regardless of the language used, by encoding in Unicode. Using the former, you must have an encoding declaration in the XML text declaration.

Oracle XML parsers are designed to be able to handle most external entities and recognize a wide range of encoding, including most widely used ones from all over the world.

The database should support all the languages you are going to use on XML. Chinese character sets such as ZHS16GBK and ZHT16BIG5 are a superset of ASCII so you may be able to use one of them to serve for English and Chinese, but you may want to use Unicode to use more languages.

Frequently Asked Questions About Reference Material

Here are some other XML Frequently Asked Question sites of interest:

What Are Some Recommended XML and XSL Books?

Answer:


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

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

Master Index

Feedback