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

All docs This doc

Versions Compared


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


  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
    <xsl:stylesheet xmlns:xsl="" xmlns:fn="" 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="/">
             <xsl:for-each select="//order/lunch[contains(drinkName, 'Coffee')]">
                   <xsl:value-of select="drinkPrice" />

Pass the following XML payload using SOAP UI.


You pass this payload into the XSLT mediator specifying a certain drinkName as a parameter to the style sheet. For example, the following payload passes the drinkName as 'Coffee'. The style sheet traverses through the incoming payload and finds the <lunch> elements, which contains 'Coffee' as drinkName. When it finds matching ectries, it adds the prices of those elements under a new <Payment> element. Therefore, when the message flow comes out of XSLT mediator, the payload changes the <Payment> entry, where it contains the drinkPrice values of matching elements.


You can get the URI of the REST API from the Management Console as shown below.

Image Added

Code Block
<meal> Rice and Curry </meal>
<mealPrice> USD 10 </mealPrice>
<drinkName> Dark Coffee </drinkName>
<drinkPrice> USD 1.8 </drinkPrice>
<meal> Sandwiches </meal>
<mealPrice> USD 4 </mealPrice>
<drinkName> Milk Shake </drinkName>
<drinkPrice> USD 2.6 </drinkPrice>
<meal> Chicken Burger </meal>
<mealPrice> USD 5 </mealPrice>
<drinkName> Iced Coffee </drinkName>
<drinkPrice> USD 1.5 </drinkPrice>
<meal> Noodles </meal>
<mealPrice> USD 8 </mealPrice>
<drinkName> Bottled Water </drinkName>
<drinkPrice> USD 2.5 </drinkPrice>