EXSLT - math:min - Use Case 7

Category: example
XML Definition: math.min.xml
Function or Template: function

Use Case

Source (view)

<sales>
   <sale qty="10"
         price="15.00" />
   <sale qty="2"
         price="12.00" />
   <sale qty="1"
         price="10.00" />
</sales>

Stylesheet (view)

<xsl:template match="/"
              xmlns:math="http://exslt.org/math">
   <out>

        Minimum:       <minprice>
         <xsl:value-of select="math:min(//sale/@price)" />
      </minprice>

        Maximum:       <maxprice>
         <xsl:value-of select="math:max(//sale/@price)" />
      </maxprice>
   </out>
</xsl:template>

Result (view)

<out xmlns:math="http://exslt.org/math">

        Minimum:    <minprice>10</minprice>

        Maximum:    <maxprice>15</maxprice>
</out>

Change History

Previous Version: ..NaN.html

VersionModifiedByDetails
12001-04-28Mike Kay

Tests functionality of math:max() and math:min().

http://www.exslt.org/math/functions/min/math.min.use-case.7.html last modified 2001-04-28