Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - group and find relative Min value [Thread Next] Re: group and find relative Min valueTo: NULL Date: 6/3/2006 3:11:00 PM
"Ghena" <lastminutesud@g...> wrote in message
news:1149337162.668450.78410@u......
> I have this xsl
>
> <?xml version='1.0' encoding='utf-8' ?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:output method="html"/>
> <xsl:key name="RouterList" match="Router" use="Supplier"/>
>
> <!-- Template for our root rule -->
> <xsl:template match="/">
> <xsl:apply-templates/>
> </xsl:template>
>
> <!-- Template for our "products" rule -->
> <xsl:template match="RouterList">
>
> <!--Step 2: Loop through the unique regions (the primary key) in our
> document. -->
> <xsl:for-each
> select="//Router[generate-id(.)=generate-id(key('RouterList',Supplier))]">
>
> <!-- Sort Primary key by name in ascending order -->
> <xsl:sort select="Supplier" order="ascending"/>
>
> <!-- Display the region as our table header -->
> <div style="background-color:#f2f2f2;"><xsl:value-of
> select="Supplier"/></div>
> <br/><br/>
> </xsl:for-each>
> </xsl:template>
>
> </xsl:stylesheet>
>
> it works well but I need to find the min value for each supplier:
>
> I tryed with: <xsl:value-of
> select="min(//Router/GroupList/Group/OutwardList/Outward/Price/Amount)"/>
>
> but is not correct
>
> But if I use
>
> <xsl:value-of
> select="//Router/GroupList/Group/OutwardList/Outward/Price/Amount"/>
>
> I display the "first" value linked to the supplier not the min one.
There is no min function. You could probably write one using some embedded
javascript though.
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
