XSLT Transformer
Example
The following example demonstrates how to configure an inline XSLT transformer pulling parameters from the current message.
To use the XSLT transformer, you add it to your Mule XML configuration as follows:
This example configures a transformer using inline XSLT expressions. It also defines two context parameters:
These parameters are pulled from the current message and made available in the XSLT context so that they can be referenced in your XSLT statements. You can use any valid expression. In this example, the header evaluator is used to pull a header from the current message.
Your configured XSLT transformer can be referenced by an endpoint. In the following example, the result is written to System.out. The test data looks like this:
The result written to System.out looks like this:
The full configuration for this example is shown below.
Testing the Transformer
This transformer can be tested using the following functional test. Note that it uses FunctionalTestCase, which is part of Mule's Test support.