Skip Headers

Oracle9i XML Developer's Kits Guide - XDK
Release 2 (9.2)

Part Number A96621-01
Go To Documentation Library
Go To Product List
Book List
Go To Table Of Contents
Go To Index

Master Index


Go to previous page Go to next page

XSLT Processor for C++

This chapter contains the following sections:

Accessing XSLT for C++

XSLT for C++ is provided with Oracle9i and Oracle9i Application Server. It is also available for download from the OTN site:

It is located at $ORACLE_HOME/xdk/cpp/parser.

XSLT for C++ Features

readme.html in the root directory of the software archive contains release specific information including bug fixes and API additions.

You can post questions, comments, or bug reports to the XML Discussion Forum at


See the following:

See Also:

XSLT for C++ (DOM Interface) Usage

Figure 17-1 shows the XSLT for C++ functionality for the DOM interface.

  1. There are two inputs to XMLParser.xmlparse():
    • The stylesheet to be applied to the XML document
    • XML document

    The output of XMLParser.xmlparse(), the parsed stylesheet and parsed XML document are sent to the XSLProcess.xslprocess() method for processing.

  2. XMLParser.xmlinit() initializes the XSLT processing. XMLParser. xmlinit() also initializes the xslprocess() result.
  3. XSLProcess.xslProcess() optionally calls other methods, such as print methods. You can see the list of available methods either on OTN or in Oracle9i XML API Reference - XDK and Oracle XML DB.
  4. The resultant document (XML, HTML, VML, and so on) is typically sent to an application for further processing.
  5. The application terminates the XSLT process by declaring XMLParser.xmlterm() for the XML document, stylesheet, and final result.

Figure 17-1 XSLT for C++ Functionality (DOM Interface) Usage

Text description of adxml057.gif follows
Text description of the illustration adxml057.gif

Invoking XSLT for C++

XSLT for C++ can be invoked in two ways:

Command Line Usage

The XSLT for C++ can be called as an executable by invoking bin/xml

Table 17-1 lists the command line options.

Table 17-1 XXSLT for C++: Command Line Options
Option Description

-e encoding

Specify input file encoding


Help - show this usage help


Version - display parser version then exit


Whitespace - preserve all whitespace



Writing C++ Code to Use Supplied APIs

XXSLT for C++ can also be invoked by writing code to use the supplied APIs. The code must be compiled using the headers in the include/ subdirectory and linked against the libraries in the lib/ subdirectory. Please see the Makefile in the sample/ subdirectory for full details of how to build your program.

Using the Sample Files Included with Your Software

$ORACLE_HOME/xdk/cpp/parser/sample/ directory contains several XML applications to illustrate how to use the XXSLT for C++.

Table 17-2 lists the sample files in sample/ directory.

Table 17-2 XML Parser for C++ sample/ Files 
sample/ File Name Description


Source for XSLSample program


Expected output from XSLSample


XML file that may be used with XSLSample


Stylesheet that may be used with XSLSample


XML version of Shakespeare's play

Running the XSLT for C++ Sample Programs

Building the Sample programs

Change directories to the sample directory and read the README file. This will explain how to build the sample programs according to your platform.

Sample Programs

Table 17-3 lists the programs built by the sample files.

Table 17-3 XML Parser for C++, Sample Programs Built in sample/
Built Program Description

XSLSample <xmlfile> <xsl ss>

Sample usage of XSL processor. It takes two filenames as input, the XML file and the XSL stylesheet. Note: If you redirect stdout of this program to a file, you may encounter some missing output, depending on your environment.

Go to previous page Go to next page
Copyright © 2001, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Go To Product List
Book List
Go To Table Of Contents
Go To Index

Master Index