Message transformation
In this case, we have a payload, but unlike what we had in the previous use case, the content is not at all similar to the payload we need. For that reason, we cannot use the Enrich mediator and must use the XSLT, FASTXSLT, XQuery, Smooks, or Script mediator.
Note
In fact, we can use the Enrich mediator, but it will be less efficient than the other WSO2 toolings that we commented on.
The XSLT mediator
With this mediator, we can perform transformations over the XML message using the XSLT language. It is useful for complex transformations, or those in which the payloads change too much and it's not possible to change the message using other tools such as the Enrich mediator.
This is the syntax:
<xslt key="string" [source="xpath"]> <property name="string" (value="literal" | expression="xpath")/>* <feature name="string" value="true| false" />* <resource location="string" key="string"/>* <...