JobMode 1 – XSL transformation

Parameter

Value

Source File

<SPOOL>/[*/]*.<IndexFileExtension>

Output

<SPOOL>/[*/]*.<IndexFileExtension>

Configuration Parameters

<PreProcessDeleteInputFiles>

<PreProcessOutputName>

<XmlToolConfigurationFile>

<XmlToolPath>

<XmlToolName>

<XmlToolOptions>

<XmlToolUseExternalProcessor>

<IndexFileExtension>

<FileNameMask>

Table 132: PreProcess: JobMode 1 – XSL transformation

Batch Processing provides simple ways to process XML files. With complex XML files, however, the internal query language and parser reach their limits. This JobMode is used for the pre-processing of complex XML files by means of XSL transformations to simplify an XML structure to pass it on to a proven Batch Processing step. All transformed XML files have temporary names (extension “tmp”) until all files have been transformed successfully.

An XSL transformation is defined by a so-called “style sheet” (file with the extension “xsl”). The complete path to this style sheet must be in the configuration parameter “XmlToolConfigurationFile”. The naming scheme of the transformed files must be specified in the parameter “PreProcessOutputName”. For example, if the transformed files should replace the original files, define the following:

PreProcessDeleteInputFiles = No
PreProcessOutputName = [FILE]

Depending on the configuration of the parameter “XmlToolUseExternalProcessor”, an internal or an external XSLT processor is used. It is recommended using the internal processor (XmlToolUseExternalProcessor = No), because this avoids inter-process communication.

Internal XSLT processor

The internal processor needs the following Perl modules:

  • XML::LibXML (Perl binding for libxml2)

  • XML::LibXSLT (interface to the GNOME libxslt library)

To use it, define the following parameters:

XmlToolUseExternalProcessor = No
XmlToolConfigurationFile = <ColdConfigDirectory>/preprocess/<SpoolType>.xsl

External XSLT processor

If the above Perl modules (LibXML and LibXSLT) cannot be installed, you can use an external processor like the following recommended one [XSLTPROC]:

  • xsltproc

The name of the processor must be specified in the parameter “XmlToolName”. If the path to the tool is not specified in the $PATH environment variable, its path must be specified in the parameter “XmlToolPath”. The options are specified in the parameter “XmlToolOptions”, so you get the following command line:

<XmlToolPath>/<XmlToolName> <XmlToolOptions>

External XSLT processor example

A simple configuration with an external XSLT processor looks as follows:

XmlToolUseExternalProcessor = Yes
XmlToolPath =
XmlToolName = xsltproc
XmlToolOptions = <XmlToolConfigurationFile> [FILE]
XmlToolConfigurationFile = <ColdConfigDirectory>/preprocess/<SpoolType>.xsl

This results in a command line as follows:

xsltproc <ColdConfigDirectory>/preprocess/<SpoolType>.xsl [FILE]