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.
XSLTransformer transforms input data records using an XSL transformation.
Component | Same input metadata | Sorted inputs | Inputs | Outputs | Java | CTL |
---|---|---|---|---|---|---|
XSLTransformer | - | no | 1 | 1 | - | - |
XSLTransformer receives data records through single input port, applies XSL transformation to specified fields and sends the records to single output port.
Port type | Number | Required | Description | Metadata |
---|---|---|---|---|
Input | 0 | yes | For input data records | Any1 |
Output | 0 | yes | For transformed data records | Any2 |
Attribute | Req | Description | Possible values |
---|---|---|---|
Basic | |||
XSLT file | 1) | External file defining the XSL transformation. | |
XSLT | 1) | XSL transformation defined in the graph. | |
Mapping | 2) | 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 field | 2),3) | URL of file, dictionary or field serving as input. | |
XML output file or field | 2),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.
Mapping can be defined using the following wizard.
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:
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.