Man kan även konvertera booleans till tal, som i C/C++, 0 blir false och 1 blir true.
<xsl:template match="person"> <xsl:value-of select="number(age)" /> <xsl:value-of select="age" /><br/> </xsl:template>
<xsl:template match="persons"> <xsl:value-of select="sum(person/age)" /> </xsl:template>
<xsl:template match="persons"> <table><thead><th> Beräknat värde, utan avrundning </th><th> 3 decimaler (om finns) </th> <th> 3 decimaler (forcerande)</th><th> round </th><th> floor </th><th> ceiling </th></thead> <xsl:for-each select="person" > <tr> <td><xsl:value-of select=".//zipcode div (position() + 1) mod age" /></td> <td><xsl:value-of select="format-number(.//zipcode div (position() + 1) mod age,'#.###')" /></td> <td><xsl:value-of select="format-number(.//zipcode div (position() + 1) mod age,'#.000')" /></td> <td><xsl:value-of select="round(.//zipcode div (position() + 1) mod age)" /></td> <td><xsl:value-of select="floor(.//zipcode div (position() + 1) mod age)" /></td> <td><xsl:value-of select="ceiling(.//zipcode div (position() + 1) mod age)" /></td> </tr> </xsl:for-each> </table> </xsl:template>
<xsl:param name="myvar" select="12" /> <xsl:param name="othervar">13</xsl:param>Om den deklareras direkt under <xsl:stylesheet>, så blir den global för hela filen.
När variabeln/parametern skall användas skrivs ett $-tecken framför. Änuu ett meningslöst exempel
<xsl:template match="persons"> <xsl:for-each select="person" > <xsl:value-of select=".//zipcode div $othervar * position() mod age - $myvar" /><br/> </xsl:for-each> </xsl:template>