SLAX Variables and Parameters Overview

You use the var and param statements to declare variables and parameters. In SLAX, the variable name contains the dollar sign even in the declaration, unlike the name attribute of <xsl:variable> and <xsl:parameter>.

param $fido;
var $bone;

The XSLT equivalent:

<xsl:parameter name="fido"/>
<xsl:variable name="bone"/>

You can declare an initial value by following the variable name with an equal sign (=) and an expression.

param $dot = .;
var $location = $dot/@location;
var $message = "We are in " _ $location _ " now.";

The XSLT equivalent is:

<xsl:parameter name="dot" select="."/>
<xsl:variable name="location" select="$dot/location"/>
<xsl:variable name="message" select="concat('We are in ', $location, ' now.')"/>