Xalan XSL transformer

This is a product of the Apache XML project available as a shared library and implemented in KCML using dynamic objects. It is used to transform XML documents using XSL stylesheets into other XML documents, HTML or plain text. It follows the W3C stylesheet recommendations and supports XPath.

A Xalan XSLT object is created with CREATE using the dynxalan shared library e.g.

OBJECT x = CREATE "dynamic", "dynxalan"

Documentation for the objects created may be found at the Xalan web site here and their implementation in KCML is documented here. Note that KCML does not implement all the features of the Xalan API at this time.

The primary object is the XalanTransformer object created from the Xalan root object with the CreateTransformer() method. This object owns all the memory of any subsequent child objects and that memory will only be freed when the transformer object goes out of scope or is explicitly NULLed.

There are some examples of using the XSLT in this manual

Xalan and Xerces

The Xalan library loads the Xerces XML library and uses it to parse XML. Xerces is not reentrant and it is not safe to have more than one copy initialized at the same time. This means that you should not instantiate a Xerces DOM object and a Xalan XSLT object in the same KCML session.

As Xalan is the superset, KCML exposes two factory methods that create DOM parser and SAX2 parser objects. These have identical functionality to the Xerces equivalents. So rather than

OBJECT x = CREATE "dynamic", "dyndom"
OBJECT p = x.CreateParser()

You can get an identical object from Xalan with

OBJECT x = CREATE "dynamic", "dynxalan"
OBJECT p = x.CreateXercesDOMParser()
Libraries

Xalan uses three shared libraries and invokes a fourth Xerces library. These have the file extension .dll on Windows, .so on Linux and most Unix versions and .sl on HP-UX.

LibraryPurpose
dynxalan.dllKCML wrapper library
Xalan-C_1_10.dllXalan main library
Xalan-Messages_1_10.dllXalan main library
xerces-c_2_7.dllXerces subsiduary library

These libraries should either be in the same directory as the KCML executables or they should in a direcory that is on $PATH (Windows), $LIBPATH (AIX), $SHLIB_PATH (HP-UX) or $LD_LIBRARY_PATH (Linux, Unix Sys5.4 etc).

Both the Xerces and Xalan libraries have version numbers embedded in their names and they must be compatible. The above table shows Xalan 1.10 and Xerces 2.7 versions.

Acknowledgement

This product includes software developed by the Apache Software Foundation (http://www.apache.org/).