xsl-list
[Top] [All Lists]

Re: Summing grouped elements

2005-02-07 06:38:01

you haven't shown enough of your stylesheet or any of your input so it's
hard to really make any suggestions, but...


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

what's the definition of $referencias, and what to teh elements in that
node set look like?

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

This is just true for the first element with each isbn.

         <xsl:for-each select="$referencias[isbn=$isbn]">
this selects all the elements with that isbn (probably you ought to be
using a key to speed this up)

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

I assume they work, without seeing your input format it's impossible to
say.


  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 -->


In that case it is most likely ../../vagas only selects one element, but
we can't say as we have not seen any input.

Make a small (3 or 4  references) input file and a small complete
stylesheet and post saying what result you get and what result you want.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>