XSLTransformer

We assume that you have already learned what is described in:

If you want to find the right Transformer for your purposes, see Transformers Comparison.

Short Summary

XSLTransformer transforms input data records using an XSL transformation.

Component Same input metadata Sorted inputs Inputs Outputs Java CTL
XSLTransformer-no11--

Abstract

XSLTransformer receives data records through single input port, applies XSL transformation to specified fields and sends the records to single output port.

Icon

Ports

Port typeNumberRequiredDescriptionMetadata
Input0yesFor input data recordsAny1
Output0yesFor transformed data recordsAny2

XSLTransformer Attributes

AttributeReqDescriptionPossible values
Basic
XSLT file1)External file defining the XSL transformation. 
XSLT1)XSL transformation defined in the graph. 
Mapping2)Sequence of individual mappings for output fields separated from each other by semicolon. Each individual mapping has the following form: $outputField:=transform($inputField) (if inputField should be transformed according to the XSL transformation) or $outputField:=$inputField (if inputField should not be transformed). 
XML input file or field2),3)URL of file, dictionary or field serving as input. 
XML output file or field2),3)URL of file, dictionary or field serving as output. 
Advanced
XSLT file charset Encoding of external file defining the XSL transformation for all data types except byte or cbyte. Default encoding is UTF-8.UTF-8 (default) | other encoding

Legend:

1): One of these attributes must be set. If both are set, XSLT file has higher priority.

2): One of these attributes must be set. If more are set, Mapping has the highest priority.

3): Either both or neither of them must be set. They are ignored if Mapping is defined.

Advanced Description

Mapping

Mapping can be defined using the following wizard.

XSLT Mapping

Figure 55.9. XSLT Mapping


Assign the input fields from the Input fields pane on the left to the output fields by dragging and dropping them in the Input field column of the right pane. Select which of them should be transformed by setting the Transform data option to true. By default, fields are not transformed.

The resulting Mapping can look like this:

An Example of Mapping

Figure 55.10. An Example of Mapping


Remember that you must set either the Mapping attribute, or a pair of the following two attributes: XML input file or field and XML output file or field. These define input and output file, dictionary or field. If you set Mapping, these two other attributes are ignored even if they are set.