This documentation is for WSO2 Enterprise Integrator version 6.1.1 . View documentation for the latest release.

All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In summary, following are the key differences between the XSLT and FastXSLT mediators:

XSLT MediatorFastXSLT Mediator

Performs XSLT transformations on the message payload.

Performs XSLT transformations on the message stream.

The message is built before processing. Therefore, you can pre-process the message payload before the XSLT transformation.The message is not built before processing. Therefore, any pre-processing on the message will not be reflected in the XSLT transformation.
The performance is slower than the FastXSLT mediator.The performance is faster than the XSLT mediator.
Note

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

omit-xml-declaration="yes"

For example:


Code Block
languagexml
<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.

Code Block
ERROR XSLTMediator Error creating XSLT transformer

...

The parameters available to configure the FastXSLT mediator are as follows.

Parameter NameDescription
Key Type

You can select one of the following options.

  • Static Key: If this is selected, an existing key can be selected from the registry for the Key parameter.
  • Dynamic Key: If this is selected, the key can be entered dynamically in the Key parameter.
Key

This specifies the registry key to refer the XSLT to. This supports static and dynamic keys.

Info
titleTip

You can click NameSpaces to add namespaces if you are providing an expression. Then the Namespace Editor panel would appear where you can provide any number of namespace prefixes and URLs used in the XPath expression. 

Info

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

...

  1. Double click on the API and click the following link in the Properties tab.
  2. Click Create & point to a new resource... link.
  3. Enter the following details to create the empty XSL file in which you enter the stylesheet, in the Registry.
  4. Double-click the stylesheet file in the Project Explorer, and add the following stylesheet as the content of the XSL file.

    Code Block
    languagexml
    titlediscountPayment.xsl
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" xmlns:m0="http://services.samples" version="2.0" exclude-result-prefixes="m0 fn">
       <xsl:output method="xml" omit-xml-declaration="yes" indent="yes" />
       <xsl:template match="/">
          <Payment>
             <xsl:for-each select="//order/lunch[fn:contains(drinkName, 'Coffee')]">
                <discount>
                   <xsl:value-of select="drinkPrice" />
                </discount>
             </xsl:for-each>
          </Payment>
       </xsl:template>
    </xsl:stylesheet>

    Pass the following XML payload using SOAP UI.

...