EXSLT - math:max - XSLT Template Implementation

Supported Version: 1
Source: math.max.template.xsl

Source

<xsl:template name="math:max">
   <xsl:param name="nodes"
              select="/.." />
   <xsl:choose>
      <xsl:when test="not($nodes)">NaN</xsl:when>
      <xsl:otherwise>
         <xsl:for-each select="$nodes">
            <xsl:sort data-type="number"
                      order="descending" />
            <xsl:if test="position() = 1">
               <xsl:value-of select="number(.)" />
            </xsl:if>
         </xsl:for-each>
      </xsl:otherwise>
   </xsl:choose>
</xsl:template>

Change History

Submitted: 2001-03-28
Creator: Jeni Tennison(http://www.jenitennison.com)

Returns the maximum value from a node-set.

Copyright

http://www.exslt.org/math.max.template.xsl.html last modified 2001-03-28