EXSLT - math:lowest

Version: 1
Status: new
Function Package: math.lowest.zip

Function Syntax

node-set math:lowest(node-set)

Template Syntax

<xsl:call-template name="math:lowest">
   <xsl:with-param name="nodes" select="node-set" />
</xsl:call-template>

The math:lowest function returns the nodes for which the result of converting the string-value of the node to a number is minimum value for the node set, as calculated with math:min.

The math:lowest template returns a result tree fragment consisting of copies of the nodes as returned by the function.

An implementation of this extension function in the EXSLT math namespace must conform to the behaviour described in this document.

Implementations

Implementations of math:lowest are available in the following languages:

Examples

element

The following example shows how to use the math:lowest function:

Source

<values>
   <value id="one">7</value>
   <value id="two">11</value>
   <value id="three">8</value>
   <value id="four">4</value>
</values>

Stylesheet

<xsl:template match="values">
   <result>
      <xsl:text>Lowest: </xsl:text>
      <xsl:value-of select="math:lowest(value)/@id" />
   </result>
</xsl:template>

Result

<result>Lowest: four</result>

Template

The following example shows how to use the math:lowest template:

Source

<values>
   <value id="one">7</value>
   <value id="two">11</value>
   <value id="three">8</value>
   <value id="four">4</value>
</values>

Stylesheet

<xsl:template match="values">
   <result>
      <xsl:text>Lowest: </xsl:text>
      <xsl:call-template name="math:lowest">
         <xsl:with-param name="nodes"
                         select="value" />
      </xsl:call-template>
   </result>
</xsl:template>

Result

<result>Lowest: four</result>

http://www.exslt.org/index.html last modified 2001-03-28