W3C home > Mailing lists > Public > www-xsl-fo@w3.org > April 2003

RE: Totals

From: <Jarno.Elovirta@nokia.com>
Date: Thu, 17 Apr 2003 09:12:36 +0300
Message-ID: <E392EEA75EC5F54AB75229B693B1B6A7052902B9@esebe018.ntc.nokia.com>
To: <kryoshida@sweetheart.com>, <www-xsl-fo@w3.org>


> I want to group and sub-total based on a SBU - Strategic Business Unit:
> There are 4 different SBU's and I want to sub-total at the end of each SBU.  How can I do this?

<xsl:key name="sbu" match="Customer" use="SBU" />

<xsl:template match="*[Customer]">
  <xsl:for-each select="Customer[generate-id(.) = generate-id(key('sbu', SBU))]">
      <xsl:for-each select="key('sbu', SBU)">
          <xsl:value-of select="CustomerNumber" />
      <xsl:text>sub-total: </xsl:text>
      <xsl:value-of select="sum(key('sbu', SBU)/PostInc)" />

XSL-List at <http://mulberrytech.com/xsl/xsl-list/> is usually a better place to ask XSLT related questions.


Jarno - VNV Nation: Procession
Received on Thursday, 17 April 2003 02:14:51 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:27 UTC