Functions defined in XSLT

<xsl:function name="math:factorial"
 xmlns:math="http://www.example.com/math"
 exclude-result-prefixes="math">
  <xsl:param name="index" type="xsd:nonNegativeInteger"/>
  <xsl:result type="xsd:positiveInteger"
    select="if ($index eq 0) then 1
            else $index * math:factorial($index - 1)"/>
</xsl:function>

Previous | Next | Top | Cafe con Leche

Copyright 2002, 2003 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified March 28, 2003