EXSLT - math:highest

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

Function Syntax

node-set math:highest(node-set)

Template Syntax

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

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

The math:highest 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:highest are available in the following languages:

Examples

element

The following example shows how to use the math:highest 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>Highest: </xsl:text>
      <xsl:value-of select="math:highest(value)/@id" />
   </result>
</xsl:template>

Result

<result>Highest: two</result>

Template

The following example shows how to use the math:highest 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>Highest: </xsl:text>
      <xsl:call-template name="math:highest">
         <xsl:with-param name="nodes"
                         select="value" />
      </xsl:call-template>
   </result>
</xsl:template>

Result

<result>Highest: two</result>

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