[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Summing grouped elements

Subject: Summing grouped elements
From: Marcos Hercules dos Santos <mhercules@xxxxxxxxx>
Date: Mon, 7 Feb 2005 11:19:43 -0200
how are elements grouped
   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="/">

<html>

</html>

   <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='nome-autor'/>.&#160;<xsl:value-of
select='titulo'/>.&#160;<xsl:value-of
select='ano'/>.&#160;<xsl:value-of select="isbn" /><br/>

&#160;</h3>

<table width="95%">
       <tr>
           <th>CURSO</th>
           <th>DISCIPLINA</th>
           <th>CODIGO</th>
           <th>VAGAS</th>
          <th>EXEMPLAR</th>
           <th>NIVEL</th>
       </tr>

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

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


<tr>
<ul>
<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/>
</tr>

</xsl:for-each>
</table>

</xsl:if><br/>

</xsl:for-each>

 </xsl:template>
</xsl:stylesheet>

Marcos Hercules

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.