Transform XML

The Transform XML action transforms an XML document contained in an XML variable using an XSLT stylesheet. The stylesheet is specified as part of the action. The result of the transformation is stored in a variable which can be of type XML, HTML, or Long Text.

The Transform XML step supports XSLT version 1.0.

The output that the stylesheet generates must be of a type that can be stored in the selected output variable. That is, if the output is to be stored in an XML variable, the stylesheet should specify <xsl:output method="xml">. If the output is to be stored in an HTML variable, the stylesheet should specify <xsl:output method="html">. If the output is to be stored in a text variable, the output method can be anything as XML, HTML, and text can all be stored as text.

A common use-case is to use an Extract Target action to store XML from a website in an XML variable, and then use a Transform XML action to transform the data and store it in the same XML variable. Finally, the Create Page action can be used to create a page displaying the XML document by choosing HTML Converted from XML Variable. This enables easy extraction of data from the transformed document using the standard extraction actions.

Properties

The Transform XML action can be configured using the following properties:

Input Variable

Select the XML variable that contains the input to the transformation. A HTML or Long Text variable can also be chosen, but it must contain valid XML.

XSLT Stylesheet

Specify the XSLT stylesheet to use for the transformation. In most cases the stylesheet will be specified as fixed XML, but you can also create the stylesheet dynamically by choosing XML from Expression or XML from Variable.

Output Variable

Select the variable where the result of the transformation should be stored. Variables of types XML, HTML, and Long Text are allowed. The XSLT stylesheet must create output that can be stored in the selected variable. Note, that the result can be stored in the same variable as the one chosen as XML input.