[xsl] Summing grouped elements

Subject: [xsl] Summing grouped elements
From: Marcos Hercules dos Santos <mhercules@xxxxxxxxx>
Date: Mon, 7 Feb 2005 11:19:43 -0200
   Hi, there are  months I'm trying  to understand why iti occurs :
I'd like to sum the element grouped , but  it  displays only one
single value under another and not the total. Why ?? Would it be  by
the generate-id use???  Can analyse my X

<xsl:template match="/">



   <h2>Grouping disciplines by Titles(ISBN) </h2>

   <xsl:for-each select="$referencias">

     <xsl:sort select="sobrenome-autor" order="ascending" />

     <xsl:variable name="isbn" select="isbn" />

     <xsl:if test="generate-id(.)=generate-id($referencias[isbn=$isbn])">

<b><xsl:value-of select='sobrenome-autor'/></b>,&#160;<xsl:value-of
select='ano'/>.&#160;<xsl:value-of select="isbn" /><br/>


<table width="95%">

         <xsl:for-each select="$referencias[isbn=$isbn]">

     <xsl:sort select="../../../@name" order="ascending" />
     <xsl:sort select="../../descricao" order="ascending" />

<th><xsl:value-of select="../../../@name"/></th>
<th><xsl:value-of select="../../descricao"/></th>
<th><xsl:value-of select="../../@id"/></th>
<th><xsl:value-of select="../../vagas"/></th>

Total: <xsl:value-of select="sum(../../vagas)" />     <--Here is my problem
it doesn't display the total, only appear the value to a single element -->

</ul> <br/>





Marcos Hercules

Current Thread