RE: [xsl] max value

Subject: RE: [xsl] max value
From: Mark Miller <storefront2000@xxxxxxxxx>
Date: Tue, 11 Dec 2001 08:20:08 -0800 (PST)
Sort and take the last value from the sort.

<xsl:template match="/values">
  <xsl:for-each select="value">
    <xsl:sort select="." data-type="number"/>
    <xsl:if test="position() = last()">
      <xsl:value-of select="."/>
    </xsl:if>
  </xsl:for-each>
</xsl:template>

Mark

> Is there a way to get the max value .
> 
> something that would look like and returns "11"
> 
> <xsl:template match="values">
>       <xsl:value-of select="max(value)" />
> </xsl:template>
> 
> <values>
>    <value>7</value>
>    <value>11</value>
>    <value>8</value>
>    <value>4</value>
> </values>


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • [xsl] max value, (continued)
    • Charly - Mon, 10 Dec 2001 16:41:21 -0800
      • Mike Brown - Mon, 10 Dec 2001 16:52:06 -0700 (MST)
    • Jeff Beadle - Tue, 11 Dec 2001 09:21:04 -0500
      • Charly - Tue, 11 Dec 2001 11:01:44 -0800
    • Mark Miller - Tue, 11 Dec 2001 08:20:08 -0800 (PST) <=
      • Charly - Tue, 11 Dec 2001 16:36:48 -0800
        • Mike Brown - Tue, 11 Dec 2001 19:04:43 -0700 (MST)
        • Charly - Wed, 12 Dec 2001 09:43:21 -0800
    • Jeff Beadle - Tue, 11 Dec 2001 11:27:29 -0500