Chapter 18: Getting Started withOracle XML and C
Oracle Database 10g includes in its default installation the Oracle XDK 10g C libraries and utilities. They provide portable XML functionalities that allow you to easily develop stand-alone or Oracle Call Interface (OCI) XML-enabled applications. In this chapter, we describe the various libraries and utilities, set up both the compile-time and run-time environments, and cover the basics of the configuration that is necessary to get connected to the Oracle database.
The Oracle XDK C Libraries
The Oracle XDK C components contain functionalities for reading, manipulating, transforming, and validating XML documents. All the Oracle XDK C components reside in the ORACLE_HOME/lib directory, and are split into the libraries described in the following sections.
libxml10.a, libxml10.so, and oraxml10.dll
In previous releases the C XML components have been in multiple libraries. In Oracle XDK 10g, these components have been consolidated into a single libxml10.a library on UNIX and an oraxml10.dll library on Windows.Within libxml10.a are the following XML components:
XML parser Checks whether an XML document is well-formed and, optionally, validates it against a DTD or XML schema. The parser can construct an object tree that can be accessed via a DOM interface or operate serially via a SAX interface.
XSLT processor Provides the capability to transform an XML document according to an XSLT stylesheet and is bundled with the parser.
XSLT Compiler Compiles XSL stylesheets into byte code, to be used later by the XSLT Virtual Machine (VM).
XSLT VM High-performance XSLT transformation engine that accepts compiled XSL stylesheets for faster processing, using less memory than the regular XSLT engine.
XML Schema processor Supports parsing and validating XML files against an XML Schema Definition (XSD) file.
While all of the XML functionality resides in these XML libraries, they do depend on two additional libraries and an optional third one as described in the following section.
libcore10.a, libcoresh20.so, and libcore10.dll
The C common run-time functions that permit Oracle code to be portable across platforms are contained in libcore10.a on UNIX and libcore10.dll on Windows. An additional library that is new in Oracle Database 10g, libcoresh20.so, supports dynamic linking on the UNIX platforms. It is also used to build libxmlsh20.so, which is why it is considerably smaller than libxml10.a.
libnls10.a and oranls10.dll
One of the advantages of the Oracle C XML implementation over others resides in its extensive internationalization support. Support for the UTF-8, UTF-16, and ISO-8859-1 character sets is provided in libnls10.a on UNIX and oranls10.dll on Windows. These libraries also depend on the environment to find their encoding and message files. The setup of the environment will be covered in a later section.
libunls10.a and oraunls10.dll
When you need support for other character sets, you also need to use libunls10.a on UNIX and oraunls10.dll on Windows. Generally, these character sets can be classified as Asian, European, or Middle Eastern language character sets. Because over 300 character sets are supported, we are not listing them here, but you can find them in Appendix A of the Oracle Data Globalization Support Guide 10g. As with the previous libraries, these also depend on the environment to find their encoding and message files.