This sample explains the usage of XslTransform() function.
Introducing XslTransform() Function
doXslTransform(string, node-set, (string, object)*) function is used to perform XSLT transformations, where BPEL variable values can be transformed into different schema. For more details on input parameters, refer to http://docs.oasis-open.org/wsbpel/2.0/CS01/wsbpel-v2.0-CS01.html#SA00039_table
Required name spaces:
doXslTransform() should be defined under
Deploying the Sample
WSO2 BPS provides a sample, which can be deployed and executed to understand the function. Follow the instructions below to deploy and trigger the process.
1. Log in into BPS server management console and select "Processes -> Add" under the "Main" menu.
2. Upload the
3. In the "Deployed Processes" window, click the "Process ID" to access its "Process Information" window.
4. Under the "WSDL Details" widget, trigger the process using the "TryIt" link to create an instance of it.
Refer to XslTransform.zip and the example usage of the function as given below:
In the above
doXslTransform(), four parameters are passed.
HelloXslWorld.xsl- Style sheet file.
$myVar.TestPart- Input source to be transformed.
middle- Name of the object to be used in the transformation.
$otherVar- Object which will be referred as 'middle'.
doXslTransform()function accepts pairs of string and objects, so that they can be referred in the style sheet. For example, in HelloXslWorld.xsl: