XSL transformation


Templates of type XSL transformation are utilized to transform an XML export file and can be used, for example, in actions of type Export (XML-File) or for exporting a form record in an Inbox.

There are some tutorials on XSL transformation at w3schools and TutorialsPoint.

Supported versions of the XSLT and XPath standards

Up to and including Xima® Formcycle version 7.2.1, only XSL transformations using the XSLT 1.0 and XPath 1.0 language standards are supported.

7.3.0+ Starting with Xima® Formcycle version 7.3, a different processor is used, which supports XSLT 3.0 and XPath 3.1.

Differences in the use of XSL transformations in Xima® Formcycle version 7.3 or higher

Basically, the XSLT processor used in newer Xima® Formcycle XSLT processor used in newer Xima® Formcycle versions supports all the language features that the older processor supported, since it is backward compatible with XSLT 1.0. 

However, the XSLT processor used in older Xima® Formcycle versions allowed certain statements that are not mandated by the language standard. This can cause existing XSL transformations to fail after updating to a Xima® Formcycle version greater than or equal to 7.3.

So far, the following problems are known:

Nested function calls

Function calls in the form

<xsl:variable name="dd">
   <xsl:value-of select="format-number(substring-before($datestr,'.'), '0' )" />
</xsl:variable>

are no longer possible. Instead, you can cache the result of the inner function in variables, for example:

<xsl:variable name="ddtemp">
   <xsl:value-of select="substring-before($datestr,'.')" />
</xsl:variable>

<xsl:variable name="dd">
   <xsl:value-of select="format-number($ddtemp, '0' )" />
</xsl:variable>

Spaces

Particularly when resolving loop variables, spaces are mandatory in certain constellations where this was not necessary before. This can be seen in the following example:

<xsl:if test="position()=1 and .!=''">

Spaces must be present here as follows:

<xsl:if test="position() = 1 and . != ''">

Functions in For-Each Loops

The comparison of the position() variable e.g. within an xsl:if block could previously be done against a string with the position value. 

<xsl:if test="position()='1'">

This never conformed to the standard, and is no longer possible. Instead, the comparison must be made with the pure numerical value:

<xsl:if test="position() = 1">