Chapter 22: Getting Started with Oracle XML and C++
Oracle Database 10g includes in its default installation the Oracle XDK 10g C++ libraries and utilities. These provide portable XML functionality that permits you to easily develop stand-alone or database 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 connect to the Oracle database.
The Oracle XDK C++ Libraries
The Oracle XDK C++ components are built upon the C components and contain the same functionality for reading, manipulating, transforming, and validating XML documents. In addition, a class generator is available for constructing XML documents. The Oracle XDK C++ components reside in the same libraries as the C components. These libraries all reside in ORACLE_HOME\lib and in XDK_HOME/lib if installed from the OTN distribution.
libxml10.a, libxml10.so, and libxml10.dl
In previous releases the C and 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 constructs an object tree that can be accessed via a DOM interface or operate serially via a SAX interface.
XSLT processor Provides the functionality to transform an XML document according to an XSLT stylesheet and is bundled with the parser.
XSLT Compiler Compiles XSLT stylesheets into byte code for use by the XSLT Virtual Machine.
XSLTVM High-performance XSLT transformation engine that accepts compiled XSLT stylesheets for faster processing using less memory.
XML Schema processor Supports parsing and validating XML files against an XML Schema Definition (XSD) file.
XML Class Generator Creates a set of C++ source files based on an input DTD or XML Schema. These classes can then be used to construct XML documents conforming to the DTD or XML schema.
While all of the XML functionality resides in this library, it does depend on an additional library to provide run-time support and an optional third library to provide globalization support 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. Even though these are C libraries, they are used for C++ applications and need to be linked in.
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 environment setup 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.