1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
<xsl:template name="Somme">
<xsl:param name="nb" />
<xsl:param name="total" />
<xsl:param name="balise" />
<xsl:param name="last" select="count($balise)+1" />
<xsl:choose>
<xsl:when test="$nb =''">
<xsl:call-template name="Somme">
<xsl:with-param name="nb" select="1" />
<xsl:with-param name="total" select="0" />
<xsl:with-param name="balise" select="$balise" />
</xsl:call-template>
</xsl:when>
<xsl:when test="$nb < $last">
<xsl:call-template name="Somme">
<xsl:with-param name="nb" select="$nb+1" />
<xsl:with-param name="total" select="$balise[position()=$nb]+$total" />
<xsl:with-param name="balise" select="$balise" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$total" />
</xsl:otherwise>
</xsl:choose>
</xsl:template> |