Skip to content

XSL Transform

XslTransform renders the widget's current XML context with its embedded Xsl stylesheet. It refreshes after data changes, with a 100 ms debounce. The rendered HTML is placed directly in the widget output.

Output and Copying

Set TargetXPath to save the rendered HTML into another node in the form data as the transform refreshes. Set AllowCopy to display a button that copies the rendered HTML. Leave TargetXPath empty for display-only transforms.

The stylesheet and its input must be trusted. The runtime inserts the transform result as HTML, so do not use this widget to render untrusted XML or user-provided XSLT. Validate both the transform and resulting HTML in the process design.

XML Fields

  • XPath selects the current XML context passed to the transform.
  • Xsl contains the XSLT stylesheet. Its first child is the stylesheet used by the widget.
  • TargetXPath is an optional child element, not an attribute. When supplied, the rendered HTML is also stored at this path; leave it empty for display-only output.
  • AllowCopy adds a command for copying the rendered HTML.

XslTransform does not accept end-user input. Its only optional data write is the generated HTML at TargetXPath.

Example

1
2
3
4
5
6
7
8
9
<XslTransform XPath="Report" AllowCopy="True">
    <TargetXPath>RenderedHtml</TargetXPath>
    <Xsl>
        <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
            <xsl:output method="html" />
            <xsl:template match="/"><div>Report preview</div></xsl:template>
        </xsl:stylesheet>
    </Xsl>
</XslTransform>