WSO2 BPS - Sample Guide - XslTransform

Sample Guide - XslTransform

Table of Content


Objective

doXslTransform(string, node-set, (string, object)*) function is used to perform XSLT transformations. So BPEL variable values can be transformed into different schemas.

For more details on input parameters, refer http://docs.oasis-open.org/wsbpel/2.0/CS01/wsbpel-v2.0-CS01.html#SA00039_table

Note : Required name spaces -

doXslTransform() should be defined under "http://docs.oasis-open.org/wsbpel/2.0/process/executable" namespace.


Prerequisites


Overall Idea

<copy><from>
        bpws:doXslTransform("HelloXslWorld.xsl", $myVar.TestPart, 'middle', $otherVar)
    </from><tovariable="myVar"part="TestPart"/></copy>

In the above doXslTransform(), four parameters are passed.

Like this doXslTransform() accepts pairs of string and objects, so that they can be referred in the style sheet.

eg - in HelloXslWorld.xsl

<xsl:value-ofselect="concat(*/content/text(), $middle, ' World')"/>