Topic: XSL grouping and XSL-FO table problem (Page 1 of 1) |
|
|---|---|
|
Neurotic (0) Inmate Newly admitted From: |
posted 04-30-2009 14:29
Hi there, code: <?xml version="1.0" encoding="iso-8859-1"?>
<zwk_export>
<record>
<field name="AG_NAME">Mabanaft GmbH & Co. KG</field>
<field name="AG_ID">0191</field>
<field name="TRANSACTION">Verkauf</field>
<field name="LAST_KONTO_NR">9813197 01</field>
<field name="LAST_BLZ">380 707 24</field>
<field name="GUNST_KONTO_NR">9690058 00</field>
<field name="GUNST_BLZ">500 700 10</field>
<field name="FOND_ISIN">LU0192142908</field>
<field name="FOND_LANG_BEZ">Institutional Euroland Equities</field>
<field name="VERWENDUNGSZWECK">241D078415201</field>
<field name="BETRAG">568,24</field>
<field name="ANTEILE">87,569</field>
</record>
<record>
<field name="AG_NAME">Mabanaft GmbH & Co. KG</field>
<field name="AG_ID">0191</field>
<field name="TRANSACTION">Kauf</field>
<field name="LAST_KONTO_NR">9813197 01</field>
<field name="LAST_BLZ">380 707 24</field>
<field name="GUNST_KONTO_NR">9690058 00</field>
<field name="GUNST_BLZ">500 700 10</field>
<field name="FOND_ISIN">LU0192144276</field>
<field name="FOND_LANG_BEZ">Institutional Euro Gov. Bonds</field>
<field name="VERWENDUNGSZWECK">241D078415201</field>
<field name="BETRAG">28968,24</field>
<field name="ANTEILE">64,569</field>
</record>
<record>
<field name="AG_NAME">GMA GmbH & Co. KG</field>
<field name="AG_ID">011</field>
<field name="TRANSACTION">Verkauf</field>
<field name="LAST_KONTO_NR">9813254 01</field>
<field name="LAST_BLZ">380 707 24</field>
<field name="GUNST_KONTO_NR">9690058 00</field>
<field name="GUNST_BLZ">500 700 10</field>
<field name="FOND_ISIN">LU0099730524</field>
<field name="FOND_LANG_BEZ">Institutional Money Plus</field>
<field name="VERWENDUNGSZWECK">114D078118202</field>
<field name="BETRAG">1268,24</field>
<field name="ANTEILE">5877,569</field>
</record>
<record>
<field name="AG_NAME">GMA GmbH CO</field>
<field name="AG_ID">011</field>
<field name="TRANSACTION">Verkauf</field>
<field name="LAST_KONTO_NR">9813254 01</field>
<field name="LAST_BLZ">380 707 24</field>
<field name="GUNST_KONTO_NR">9690058 00</field>
<field name="GUNST_BLZ">500 700 10</field>
<field name="FOND_ISIN">LU0192142908</field>
<field name="FOND_LANG_BEZ">Institutional Euroland Equities</field>
<field name="VERWENDUNGSZWECK">114D078118202</field>
<field name="BETRAG">57692,24</field>
<field name="ANTEILE">77,569</field>
</record>
<commonData>
<field name="ORDERDATUM">04.27.2009</field>
<field name="KONZERN_NAME">Marquard & Bahls AG</field>
</commonData>
</zwk_export>
code: <?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/>
<xsl:key name="groups-by-ag_id" match="record" use="field" />
<xsl:template match="zwk_export">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xml.apache.org/fop/extensions">
<fo:layout-master-set >
<fo:simple-page-master margin-right="0.5cm" margin-left="0.5cm" margin-bottom="0.5cm" margin-top="0.5cm" page-width="21cm" page-height="29.7cm" master-name="konzernOrder">
<fo:region-body margin-bottom="2cm" margin-top="3.5cm"/>
<fo:region-before extent="3.5cm" />
<fo:region-after extent="2cm" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="konzernOrder" language="de" hyphenate="false">
<fo:static-content flow-name="xsl-region-before" >
<fo:block>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after" >
<fo:block >
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" margin-top="0cm" margin-bottom="0cm">
<fo:block line-height="12pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always">
<fo:block space-before="0.2cm" space-after="0.3cm" >
<fo:table text-align="left" keep-together="auto" border="0.5pt solid black">
<fo:table-column column-width="5.95cm" border="0.5pt solid black" />
<fo:table-column column-width="2.05cm" border="0.5pt solid black" />
<fo:table-column column-width="5.80cm" border="0.5pt solid black" />
<fo:table-header text-align="center" border="0.5pt solid black" >
<fo:table-cell>
<fo:block >
<fo:inline font-weight="bold" font-size="6pt">AG_NAME</fo:inline>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block >
<fo:inline font-weight="bold" font-size="6pt">AG_ID</fo:inline>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block >
<fo:inline font-weight="bold" font-size="6pt">ISIN</fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-header>
<fo:table-body>
<!-- <xsl:for-each select="record"> -->
<xsl:for-each select="key('groups-by-ag_id', field[@name='AG_ID'])">
<fo:table-row height="auto" >
<fo:table-cell display-align="center" text-align="center" margin-right="2pt" margin-left="1pt" border="0.5pt solid black">
<fo:block font-size="6pt" line-height="auto" keep-together="auto" space-before="0.5pt" space-after="0.5pt">
<xsl:value-of select="field[@name='AG_NAME']"/>
</fo:block>
</fo:table-cell >
<fo:table-cell display-align="center" text-align="center" margin-right="2pt" margin-left="1pt" border="0.5pt solid black">
<fo:block font-size="6pt" keep-together="auto" space-before="0.5pt" space-after="0.5pt">
<xsl:value-of select="field[@name='AG_ID']"/>
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center" text-align="center" margin-right="2pt" margin-left="1pt" border="0.5pt solid black">
<fo:block font-size="6pt" keep-together="auto" space-before="0.5pt" space-after="0.5pt">
<xsl:value-of select="field[@name='FOND_ISIN']"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:block>
</fo:block>
<fo:block id="last-page"/>
</fo:flow>
|
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 05-02-2009 10:23
hey, I think the xsl:for-each-group element is what you're looking for. |
|
Neurotic (0) Inmate Newly admitted From: |
posted 10-14-2010 16:36
Thanks for these instructions. They were very helpful, and I appreciate you going to the effort of creating this page. |