This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

The FastXSLT Mediator is similar to the XSLT mediator, but it uses the Streaming XPath Parser and applies the XSLT transformation to the message stream instead of to the XML message payload. The result is a faster transformation, but you cannot specify the source, properties, features, or resources as you can with the XSLT mediator.

FastXSLT mediator is intended to be used with messages that are not being built before the mediator receives the message. Any pre-processing performed on the message payload will not be visible to the FastXSLT mediator, because the transformation logic is applied on the original message stream instead of the message payload. In cases where message payload needs to be pre-processed, use the XSLT mediator instead of the FastXSLT mediator.

To enable the FastXSLT mediator, your XSLT script must include the following parameter in the XSL output:

omit-xml-declaration="yes"

For example:
<xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" indent="yes"/>

If you do not include this parameter in your XSLT when using the FastXSLT mediator, you will get the following error: "ERROR XSLTMediator Error creating XSLT transformer"



Syntax

<fastxslt key="string"/> 

 


UI Configuration

  • Key Type - Specifies whether to use a static or dynamic key for referencing the XSLT file.
  • Key - Specifies the registry key of the XSLT file. When specifying a dynamic key, you can click the Namespaces link to add namespaces if you are providing an expression.

You can also configure the mediator using XML. Click switch to source view in the Mediator window.


Example

<fastxslt xmlns="http://ws.apache.org/ns/synapse" key="transform/example.xslt"/>

In this example, the XSLT is specified by the key transform/example.xslt, which is used to transform the message stream.

  • No labels