Hi,
I have read the documentation regarding the grouping and the different
examples to count the different groups and now my xslt file is doing
this but I need as well to sum the different groups to have a total of
groups but I can't get working.
How I can get this result before enter the for-each loop? I need this
before to make a paginate page.
So If I have:
Group1
2 elements
Group2
1 element
Group3
3 elements
I need to have that the number of groups is 3.
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes"
encoding="ISO-8859-1"/>
<xsl:key name="hotelname" match="product" use="name" />
<xsl:template match="body">
<xsl:param name="counter" select="0"/>
<xsl:for-each select="product[count(. | key('hotelname', name)[1]) =
1]">
Number of elements for this group : <xsl:value-of
select="$counter + count(key('hotelname', name))" /><br></br>
<xsl:sort select="name" />
<xsl:value-of select="name" />,<br />
<xsl:for-each select="key('hotelname', name)">
<xsl:value-of select="productID" /> <br />
<xsl:with-param name="counter" select="$counter +
1"/>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
I would appreciate your help
Regards
Frank
Chasetravel.ie, Winner ITTN Awards 2005.
"Best Hotel Booking Engine"