Transformations in Transformation language (TML)

TML provides a set of commands and language elements. Using these, the script author can define how one data format can be transformed into another, for example, using the map command, and can also set specific target data values, for example, the set command.

To support more complicated generation, for example where the output data is calculated based on values in the input data, TML supports writing script functions in JavaScript.

The commands specified must include the target data-path and may also include the source data-path.

Target data in TML

Data-paths are provided as parameters to TML commands, where each command in TML is responsible for generating data in the output. Fundamental to each command is the target parameter. This parameter is a data-path that TML uses to build the structure of the output document and identify where data values should be written.

Source data in TML

When data is being mapped from the input to the output, TML is used to specify how the source data should be handled. Specifically, whether the data path for the source should be processed iteratively (i.e. for each occurrence) or whether the data path should be processed only once. This is to handle single parent-multiple child structures, such as one header, many lines.

Generally, where a field in the input represents a single data value, this data should be processed only once. When the source specifies a containing record (e.g.a header contains lines), the source should be processed iteratively (i.e. in a for-each loop).