Oracle8i Application Developer's Guide - XML Release 3 (8.1.7) Part Number A86030-01 |
|
Using XML Parser for Java, 2 of 22
Oracle provides a set of XML parsers for Java, C, C++, and PL/SQL. Each of these parsers is a stand-alone XML component that parses an XML document (or a standalone DTD) so that it can be processed by an application. Library and command-line versions are provided supporting the following standards and features:
Additional features include:
The parsers are available on all Oracle platforms.
See Figure 17-1. The XML Parser for Java inputs an XML document. The DOM or SAX parser interface parses the XML document. The parsed XML is then transferred to the application for further processing.
If a stylesheet is used, the DOM or SAX interface also parses and outputs the XSL commands. These are sent together with the parsed XML to the XSL-T Processor where the selected stylesheet is applied and the transformed (new) XML document is then output.
DOM and SAX APIs are explained in "DOM and SAX APIs".
The classes and methods used to parse an XM document are illustrated in the following diagrams:
The classes and methods used by the XSL-T Processor to apply stylesheets are illustrated in the following diagram:
The V2 versions of the XML Parsers include an integrated XSL Transformation (XSL-T) Processor for transforming XML data using XSL stylesheets. Using the XSL-T processor, you can transform XML documents from XML to XML, XML to HTML, or to virtually any other text-based format. See Figure 17-1.
The processor supports the following standards and features:
The Java, C, and C++ XML parsers also support XML Namespaces. Namespaces are a mechanism to resolve or avoid name collisions between element types (tags) or attributes in XML documents.
This mechanism provides "universal" namespace element types and attribute names whose scope extends beyond this manual.
Such tags are qualified by uniform resource identifiers (URIs), such as:
<oracle:EMP xmlns:oracle="http://www.oracle.com/xml"/>
For example, namespaces can be used to identify an Oracle <EMP> data element as distinct from another company's definition of an <EMP> data element.
This enables an application to more easily identify elements and attributes it is designed to process. The Java, C, and C++ parsers support namespaces by being able to recognize and parse universal element types and attribute names, as well as unqualified "local" element types and attribute names.
The Java, C, and C++ parsers can parse XML in validating or non-validating modes.
Validation involves checking whether or not the attribute names and element tags are legal, whether nested elements belong where they are, and so on.
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|