This chapter explains how to use the Extensible Stylesheet Language Transformation (XSLT) processor for C++.
Note:
Use the unified C++ application programming interface (API) inxml.hpp
for Oracle XML Developer's Kit (XDK) applications. The older, nonunified C++ API in oraxml.hpp
is deprecated and supported only for backward compatibility. It will be removed in a future release.Extensible Stylesheet Language Transformation (XSLT) for C++ is provided with Oracle Database. Sample files are located at xdk/demo/cpp/new
.
readme.html
in the root directory of the software archive contains release specific information including bug fixes and API additions.
See Also:
"XSLT XVM Processor"This is the namespace for XSLT compilers and transformers.
XslException
Interface—Root interface for all XSLT-related exceptions.
Transformer
Interface—Basic XSLT processor. You can use this interface to invoke all XSLT processors.
CompTransformer
Interface—Extended XSLT processor. You can use this interface only with processors that create intermediate binary bytecode (currently only the XVM-based processor).
Compiler
Interface—XSLT compiler. It is used for compilers that compile XSLT into binary bytecode.
See Also:
Oracle Database XML C++ API Reference package XSL APIs for C++There are two inputs to XMLParser.xmlparse()
:
The Extensible Markup Language (XML) document
The style sheet to be applied to the XML document
Any XSLT processor is initiated by invoking the tools factory to create a particular XSLT transformer or compiler.
The style sheet is supplied to any transformer by invoking setXSL()
member functions.
The XML instance document is supplied as a parameter to the transform member functions.
The resultant document (XML, HTML, Vector Markup Language (VML), and so on) is typically sent to an application for further processing. The document is sent as a Document Object Model (DOM) tree or as a sequence of Simple API for XML (SAX) events. SAX events are produced if a SAX event handler is provided by the user.
The application terminates the XSLT processors by invoking their destructors.
XSLT for C++ can be invoked in two ways:
By invoking the executable on the command line
By writing C++ code and using the supplied APIs
XSLT for C++ can also be invoked by writing code to use the supplied APIs. The code must be compiled using the headers in the public
subdirectory and linked against the libraries in the lib
subdirectory. See Makefile
or make.bat
in xdk/demo/cpp/new
for full details of how to build your program.
The $ORACLE_HOME/xdk/demo/cpp/parser/
directory contains several XML applications to show how to use the XSLT for C++.
Table 28-1 lists the sample files.
Table 28-1 XSLT for C++ Sample Files
Sample File Name | Description |
---|---|
XSLSampleMain.cpp XSLSampleGen.cpp XSLSampleGen.hpp |
Sources for sample XSLT usage program. |
XVMSampleMain.cpp XVMSampleGen.cpp XVMSampleGen.hpp |
Sources for the sample XSLT Virtual Machine (XVM) usage program. |