EXSLT - math:max - EXSLT Function Implementation

Supported Version: 1
XML Definition: math.max.xml
Source: math.max.function.xsl

Source

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

Change History

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

Returns the maximum value from a node-set.

VersionModifiedByDetails
1.12001-04-28Jeni Tennison
  • Added condition that math:max() must return NaN if any of the values of the nodes in the node set passed as the argument have a numerical value of NaN.
  • Changed the definition of the maximum to be the value of the first node in the node list when sorted as with xsl:sort with a data type of number in descending order.
1.22001-05-22Jeni Tennison
  • Added vendor implementations in Saxon and 4XSLT
  • Changed status to stable
1.32001-06-11Jeni Tennison

Added vendor implementation in jd.xslt.

1.42001-08-23Jeni Tennison

Added vendor implementation in libxslt.

1.52002-08-20Craig Stewart

Added Xalan-J implementation to the list.

1.62002-11-12Craig Stewart

Updated 4XSLT version to 0.12.0a3.

Copyright

http://www.exslt.org/math/functions/max/math.max.function.xsl.html last modified 2002-11-12