Re: Subtotals

At 2003-04-22 16:07 -0400, Yoshida, Ken wrote:
>I would like to achieve the following
>
>SBU     CustomerNumber           Customer          PostIncPrice
>F          1234                             Cust1                1.00
>F          2345                             Cust2                2.00
>                                                                         3.00
>...
>I have a key:
>
><xsl:key name="sbu" match="Customer" use="SBU" />
>
>Doing to "for-each selects" as follows using two tables row:
>
><xsl:for-each select="Customer[generate-id(.) = generate-id(key('sbu', 
>SBU))]">
><xsl:for-each select="key('sbu', SBU)">
>
><fo:table-row border-width="0.5pt" break-after="page">
>...
></fo:table-row>
></xsl:for-each>

<fo:table-row
   <fo:table-cell
     <xsl:value-of select="format-number( '0.##', sum(key('sbu',SBU)))"/>

I hope this helps.

.............. Ken


--
Upcoming hands-on courses:   Europe (XSLT/XPath):    May  5, 2003
-                            Europe (XSL-FO):        May 16, 2003
- (XSLT/XPath and/or XSL-FO) North America:      June 16-20, 2003

G. Ken Holman                mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.         http://www.CraneSoftwrights.com/f/
Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6                      Definitive XSLT and XPath
ISBN 0-13-140374-5                              Definitive XSL-FO
ISBN 1-894049-08-X  Practical Transformation Using XSLT and XPath
ISBN 1-894049-10-1              Practical Formatting Using XSL-FO
Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc

Received on Tuesday, 22 April 2003 16:47:35 UTC