Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: group and find relative Min value group and find relative Min valueTo: NULL Date: 6/3/2006 5:19:00 AM
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.
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
