Transformations are typically linked to an endpoint, and will transform the input into a message that will be send. Transformations can be chained, and are optional. (So instead of using NONE you can just not provide 0 transformations.)
Technically at most 3 transformations should be required to create almost any reasonable result. (TO XML -> XSLT -> TO JSON) However it could be a good idea to chain multiple XSLT transformations. For example the first XSLT could just be the version from the D9A kit, followed by a second transformation that holds customer specific changes. This has 2 big advantages: 1) it is clear what the customizations are; and 2) it allows to upgrade the D9A transformation if a new version is available without having to redo the customizations to it. There is however also a drawback; only data that is still available in the output from the first XSLT can still be used in the 2nd XSLT.
XSLT
The most important transformation is the XSLT because it allows custom logic.
Only XSLT version 1.0 is supportd.
<book> <author> <firstName>Yuval</firstName> <firstName>Noah</firstName> <familyName>Harari</familyName> </author> <title>Sapiens: A brief history of humankind</title> <releaseDate>10-02-2015</releaseDate> <isbn>9780062316097</isbn></book>
This example converted an input to a different format. Note that the transformation can only add fixed "extra" data, but can not invent data. So all the real data should either come from the input, or be encoded in the XSLT itself.
Special Functions
There are a few helper functions available that assist with problems that are difficult to solve with the XSLT 1.0 functions available. List of currently available functions:
In namespace e-platform:helpers/v1
Increment()
Returns a new number every time it is called. Incrementing the previous number with 1.
Increment('<<counter>>')
Creates a "counter" with key <<counter>> and returns an incremented value each time it is called.
GetCounterValue('<<counter>>')
Returns the current value of the counter with name <<counter>>.
To use a special function the namespace must be referenced in an xmlns:xxx="namespace" attribute at the top of the file. See the example below that creates a "scripts" which is then used to call the functions.
This transformation can be used if the input message, or the output of the previous stage in the transformation chain is an XML, and it has to be converted to a JSON object.
One special case is to be mentioned, output that should be transformed to a number must be indicated as such by wrapping the number in `TONUMBER(...)` text.