Hi I have the following FO XSL document with the following data
I am trying to add sub totals for each group in a XSL document but
cannnot seem to work it out!
Output would be something like:-
Area 1
--- Name 1.1
--- Name 1.2
--- Name 3.1
Sub total = 3
Area 2
--- Name 2.1
--- Name 2.2
Sub total = 2
Grand total = 5
Can anyone help?
##### BEGIN XSL DOC ######
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<!-- defines the layout master -->
<fo:layout-master-set>
<fo:simple-page-master master-name="first" page-height="21cm"
page-width="29.7cm" margin-top="1cm" margin-bottom="1cm"
margin-left="1.5cm" margin-right="1.5cm">
<fo:region-body margin-top="15mm" margin-left="0mm"
margin-right="0mm" margin-bottom="0mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<!-- starts actual layout -->
<fo:page-sequence master-reference="first">
<!--start - page body-->
<fo:flow flow-name="xsl-region-body" font-size="9pt">
<!--wrapper table-->
<fo:block>
<fo:table margin-top="10mm" table-layout="fixed"
width="100%">
<fo:table-column
column-width="proportional-column-width(1)"/>
<fo:table-column
column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell padding="3pt"
border-bottom-style="solid" border-bottom-color="#000000"
border-bottom-width="1px">
<fo:block>LLSC</fo:block>
</fo:table-cell>
<fo:table-cell padding="3pt"
border-bottom-style="solid" border-bottom-color="#000000"
border-bottom-width="1px">
<fo:block>Nextstep site</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:for-each select="Root/Data">
<fo:table-row>
<fo:table-cell padding="3pt"
border-bottom-style="solid" border-bottom-color="#EEEEEE"
border-bottom-width="1px">
<fo:block>
<xsl:value-of select=".//LLSCName"/>
</fo:block>
</fo:table-cell>
<fo:table-cell padding="3pt"
border-bottom-style="solid" border-bottom-color="#EEEEEE"
border-bottom-width="1px">
<fo:block padding-left="10mm">
<xsl:value-of select=".//NextstepName"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:block>
</fo:flow>
<!--End - page body-->
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
##### END XSL DOC ######
##### BEGIN XML DOC ######
<?xml version="1.0" standalone="yes"?>
<Root>
<Data>
<LLSCName>Area 1</LLSCName>
<NextstepName>Name 1.1</NextstepName>
</Data>
<Data>
<LLSCName>Area 1</LLSCName>
<NextstepName>Name 2.1</NextstepName>
</Data>
<Data>
<LLSCName>Area 1</LLSCName>
<NextstepName>Name 3.1</NextstepName>
</Data>
<Data>
<LLSCName>Area 2</LLSCName>
<NextstepName>Name 2.1</NextstepName>
</Data>
<Data>
<LLSCName>Area 2</LLSCName>
<NextstepName>Name 2.2</NextstepName>
</Data>
</Root>
##### END XML DOC ######