XML Technologies Supported by Oracle

This section will briefly discuss the XML technologies supported by Oracle. The XML technologies supported by Oracle can be separated into the following categories:

  • Database XML Support

  • XML Developer s Kit (XDK) for Java

  • XDK for Java Beans

  • XDK for C

  • XDK for C++

  • XDK for PL/SQL

Database XML Support

  • XMLType A new datatype to store, query, and retrieve XML documents. XMLType is a system defined datatype with predefined member functions to access XML data. You can perform the following tasks with XMLType:

    • Create columns of XMLType and use XMLType member functions on instances of the type

    • Create PL/SQL functions and procedures, with XMLType as argument and return parameters

    • Store, index, and manipulate XML data in XMLType columns

  • SYS_XMLGEN A SQL function to create XML documents. SYS_XMLGEN is a SQL function, which generates XML within SQL queries. DBMS_XMLGEN and other packages operate at a query level, giving aggregated results for the entire query. SYS_XMLGEN operates on a single argument inside a SQL query and converts the result to XML. SYS_XMLGEN takes in a scalar value, an object type, or an XMLType instance to be converted to an XML document. It also takes an optional XMLGenFormatType object to specify formatting options for the result. SYS_XMLGEN returns a XMLType.

  • SYS_XMLAGG A SQL function to aggregate multiple XML documents. SYS_XMLAGG is an aggregate function, which aggregates over a set of XMLTypes. SYS_XMLAGG aggregates all the input XML documents/fragments and produces a single XML document by concatenating XML fragments and adding a top-level tag.

  • DBMS_XMLGEN A built-in package to create XML from SQL queries. DBMS_XMLGEN is a PL/SQL package that converts the results of SQL queries to canonical XML format, returning it as XMLType or CLOB. DBMS_XMLGEN is implemented in C, and compiled in the database kernel. DBMS_XMLGEN is similar in functionality to DBMS_XMLQuery package.

  • URI support Store and retrieve global and intra-database references. The UriType family of types can store and query Uri-refs in the database. SYS.UriType is an abstract object type that provides functions to access the data pointed to by the URL. SYS.HttpUriType and SYS.DBUriType are subtypes of UriType. The HttpUriType can store HTTP URLs and the DBUriType can store intra-database references. You can also define your own subtypes of SYS.UriType to handle different URL protocols. The UriFactory package is a factory package that can generate instances of these UriTypes automatically by scanning the prefix, such as http://, ftp://, etc. Users can also register their own subtypes with UriFactory, specifying the supported prefix. For example, a subtype to handle the gopher protocol can be registered with UriFactory, specifying that URLs with the prefix gopher:// are to be handled by your subtype. UriFactory now generates the registered subtype instance for any URL starting with that prefix.

  • Text support Supports XPath (the open standard syntax for addressing elements within a document used by XSL and XPointer) on XMLType and text columns.

XML Developer ˜s Kit (XDK) for Java

  • XML Parser for Java Library and command-line versions are provided that support the following standards and features:

  • XML W3C XML 1.0 Recommendation

  • DOM An integrated DOM (Document Object Model) API, compliant with: W3C DOM 1.0 Recommendation, W3C DOM 2.0 CORE Recommendation, W3C DOM 2.0 Traversal Recommendation, including Treewalker, Node Iterator, and Node Filter.

  • SAX An integrated Simple API for XML (SAX) API, compliant with the SAX 2.0 recommendation. These APIs permit an application to process XML documents using an event-driven model.

    • W3C Proposed Recommendation for XML Namespaces 1.0, thereby avoiding name collision, increasing reusability, and easing application integration. Supports Oracle XML Schema Processor. See also http://www.w3.org/TR/1999/REC-xml- names -19990114/.

    • Validating and non-validating modes.

    • Built-in error recovery until fatal error.

    • DOM extension APIs for document creation.

  • XSLT Processor for Java Includes the following features:

    • Integrated support for W3C XSLT 1.1 Working Draft

    • Provides new APIs to get XSL Transformation as SAX output

  • XML Schema Processor for Java Supports XML Schema Processor that parses and validates XML files against an XML Schema Definition file (.xsd). It includes the following features:

    • Built on the XML Parser for Java v2

    • Supports the three parts of the XML Schema Working Draft :Part 0: Primer XML Schema, Part 1: Structures XML Schema, Part 2: Datatypes

    • Runs on Oracle and Oracle Application Server

  • XML Class Generator for Java XML Class Generator for Java creates Java source files from an XML Document Type Definition (DTD) or XML Schema Definition. The generated classes can be used to programmatically construct XML documents. XML Class Generator for Java also optionally generates javadoc comments on the generated source files. XML Class Generator for Java requires the XML Parser for Java and the XML Schema Processor for Java. It works in conjunction with XML Parser for Java, which parses the DTD (or XML Schema) and sends the parsed XML document to the Class Generator. XML Class Generator for Java consists of the following two class generators (both of which can be invoked from the command line utility, oracg):

    • DTD Class Generator

    • XML Schema Class Generator

  • XSQL 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 an XML file containing embedded SQL queries as its input. 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:

    • Build dynamic XML datapages from the results of one or more SQL queries and serve the results over the Web as XML datagrams or HTML pages using server-side XSLT transformations

    • Receive XML posted to your web server and insert it into your database

  • XML SQL Utility (XSU) for Java Oracle XML SQL Utility (XSU) supports Java and PL/SQL. XML SQL Utility is comprised of core Java class libraries for automatically and dynamically rendering the results of arbitrary SQL queries into canonical XML. It includes the following features:

    • Supports queries over richly-structured user -defined object types and object views.

    • Supports 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.

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

    • Generate from an SQL query or Result set object a text or XML document, a DOM, DTD, or XML Schema.

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

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

    • Pass a query to the database and generate an XML document (text or DOM) from the results or the DTD, which can be used for validation.

    • Write XML data to a database table.

    Note  

    Of all of the XML technologies supported by Oracle, XSU is one of the most frequently used. The final section of this chapter, The XML SQL Utility (XSU) for Java and PL/SQL, explores the XSU.

XDK for Java Beans

  • XML Transviewer Beans A set of XML components that constitute XML for Java Beans. These are used for Java applications or applets to view and transform XML documents. They are visual and nonvisual Java components that are integrated into Oracle JDeveloper 10 g to enable the fast creation and deployment of XML-based database applications. The following beans are available:

    • DOMBuilder Bean This bean wraps the Java XML (DOM) parser with a bean interface, allowing multiple files to be parsed at once (asynchronous parsing). By registering a listener, Java applications can parse large or successive documents while having control return immediately to the caller.

    • XML Source Viewer Bean This bean extends JPanel by enabling the viewing of XML documents. It improves the viewing of XML and XSL files by color -highlighting XML and XSL syntax. This is useful when modifying an XML document with an editing application. Easily integrated with the DOM Builder Bean, it allows for preparsing, postparsing, and validation against a specified DTD.

    • XML Tree Viewer Bean This bean extends JPanel by enabling users top view XML documents in tree form with the ability to expand and collapse XML parsers. It displays a visual DOM view of an XML document, enabling users to easily manipulate the tree with a mouse to hide or view selected branches.

    • XSL Transformer Bean This bean wraps the XSLT Processor with a bean interface and performs XSL transformations on an XML document based on an XSL stylesheet. It enables users to transform an XML document to almost any text-based format, including XML, HTML, and DDL, by applying an XSL style sheet. When integrated with other beans, this bean enables an application or user to view the results of transformations immediately. It can also be used as the basis of a server-side application or servlet to render an XML document, such as an XML representation of a query result, into HTML for display in a browser.

    • XML TransPanel Bean This bean uses the other beans to create a sample application, which can process XML files. It includes a file interface to load XML documents and XSL style sheets. It uses these beans:

  • Visual beans to view and edit files

  • Transformer beans to apply the style sheet to the XML document and view the output

XDK for C

  • XML Parser for C This parser will check if an XML document is well- formed , and optionally validate it against a DTD. It constructs an object tree, which can be accessed through a DOM interface or operated serially via a SAX interface. XML Parser for C is provided with Oracle and Oracle Application Server, located in $ORACLE_HOME/xdk/c/parser.

  • XML Schema Processor for C See the preceding XML Schema Processor for Java entry.

XDK for C++

  • XML Parser for C++ See the preceding XML Parser for C entry

  • XML Schema Processor for C++ See the preceding XML Schema Processor for Java

  • XML Class Generator for C++ See the preceding XML Class Generator for Java

XDK for PL/SQL

  • XML Parser for PL/SQL See the preceding XML Parser for C

  • XML SQL Utility (XSU) for PL/SQL Comprised of a PL/SQL package that wraps the XML SQL Utility for Java (see preceding description)



Oracle Application Server 10g Web Development
Oracle Application Server 10g Web Development (Oracle Press)
ISBN: 0072255110
EAN: 2147483647
Year: 2004
Pages: 192

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net