xslTransform Step

Use this step to perform XSL transform on XML document.

Last published at: March 24th, 2025

Description:

This step performs an XSL transform on an XML document.

 

Inputs

  • xmlVariable – variable holding the XML data
  • xslFilePath – file path to the XSLT file on the FlowWright server
  • variableToStore – variable to store the XSL transform result 
 

 

Returns

  • True – step executed successfully
  • False – step failed to execute 
 

 

Usage:

 

 

Example:

Let’s build and execute the “xslTransformDef” example.          

  • Create a new definition called “xslTransformDef” 
  • Select the definition and click the “design” button
  • Drag the “updateVariable, xslTransform” steps to the canvas 
  • Define a variable/global to store the XML value and XSL transform result
  • Click the "updateVariable" step to configure its "Required" properties. Provide a name to the step.

 

  • Click the "updateVariable" step to configure its "Optional" properties. Click the button to configure multiple variable references. A popup window is displayed for configuration. Click the Add Row button to insert an empty row. Provide the variable and the XML value. Click the Save button. You may insert multiple variables by using the Add Row button.  Provide the variable/global reference and the XML value for a single variable reference. Configure “Yes” if the XML value has an expression. 

 

  • Sample XML value (for reference)
<root>
  <Book1>
    <MaterialID>123456789</MaterialID>
    <MaterialName>Roman Test</MaterialName>
    <Quantity>123.6</Quantity>
    <UoM>Kg</UoM>
    <Tolerance>2</Tolerance>
  </Book1>
  <Book1>
    <MaterialID>123456790</MaterialID>
    <MaterialName>Roman Test 2</MaterialName>
    <Quantity>133.6</Quantity>
    <UoM>Kg</UoM>
    <Tolerance>3</Tolerance>
  </Book1>
  <Book1>
    <MaterialID>123456791</MaterialID>
    <MaterialName>Roman Test</MaterialName>
    <Quantity>143.6</Quantity>
    <UoM>Kg</UoM>
    <Tolerance>4</Tolerance>
  </Book1>
  <Book1>
    <MaterialID>123456792</MaterialID>
    <MaterialName>Roman Test 3</MaterialName>
    <Quantity>153.6</Quantity>
    <UoM>Kg</UoM>
    <Tolerance>5</Tolerance>
  </Book1>
  <Book1>
    <MaterialID>123456793</MaterialID>
    <MaterialName>Roman Test</MaterialName>
    <Quantity>163.6</Quantity>
    <UoM>Kg</UoM>
    <Tolerance>6</Tolerance>
  </Book1>
</root>

 

  • Click the "xslTransform" step to configure its "Required" properties. Give the step a name.

 

  • Click the "xslTransform" step to configure its "Optional" properties. Provide the variable/global to store the XSL transform output, the variable/global that holds the XML value, and the XSL file path value on the app server. 

 

  • Sample XSL file template (for reference)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  <body>
    <h2>The List</h2>
    <table border="1">
      <tr bgcolor="#9acd32">
        <th>MaterialID</th>
        <th>Name</th>
		<th>Quantity</th>
		<th>Unit Of Measure</th>
		<th>Tolerance Value</th>
      </tr>
      <xsl:for-each select="root/Book1">
      <tr>
        <td><xsl:value-of select="MaterialID" /></td>
        <td><xsl:value-of select="MaterialName" /></td>
        <td><xsl:value-of select="Quantity" /></td>
        <td><xsl:value-of select="UoM" /></td>
        <td><xsl:value-of select="Tolerance" /></td>
      </tr>
      </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

 

  • The “Logging” setting configuration is necessary for documentation and also measures the workflow progress and the percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

 

  • Save the process definition, create a new instance, and execute. Render the process instance. Click on the process step. The step shall transform the XML to XSL using the template file.

 

Definition Sample:

You may download the ZIP file and extract the sample definition(s) from the link here. Then, you can later import it (drag-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.

NOTE: Please verify and complete the process steps for any missing configurations, such as file path references and database connections after import. Then, save the definition to confirm the changes.

Click here to download the sample file.

 

How can we improve this article?

Share additional info and suggestions