EXSLT - math:lowest - EXSLT Function Implementation

Supported Version: 1
Source: math.lowest.function.xsl

Source

<exsl:function name="math:lowest">
   <xsl:param name="nodes"
              select="/.." />
   <xsl:choose>
      <xsl:when test="$nodes and not($nodes[number(.) != number(.)])">
         <xsl:variable name="min">
            <xsl:for-each select="$nodes">
               <xsl:sort data-type="number" />
               <xsl:if test="position() = 1">
                  <xsl:value-of select="number(.)" />
               </xsl:if>
            </xsl:for-each>
         </xsl:variable>
         <exsl:return select="$nodes[. = $min]" />
      </xsl:when>
      <xsl:otherwise>
         <exsl:return select="/.." />
      </xsl:otherwise>
   </xsl:choose>
</exsl:function>

Change History

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

Returns the nodes with the minimum value in a node set.

Copyright

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