XSL:FO page break

R

Rary

I am using XSL:FO to generate PDF report for my XML, generating it in
tables, i want that tables should completely be at one place, if there
is a page break , all the contents of the table should move to the
next page.
can any one suggest a way out?
This is my code (number 18, Brunelli Rocco, should move to the next
page):

XML:
<?xml version="1.0" encoding="windows-1252"?>
<?xml-stylesheet href="XSL/ppt.xsl" type="text/xsl"?>
<turns>
<emps>
<emp familyname="ROSSI" name="MARIO" id="12345" />
<emp familyname="NERI" name="ALDO" id="67891" />
<emp familyname="BIANCHI" name="BRUNO" id="65432" />
<emp familyname="VERDI" name="GINO" id="58971" />
<emp familyname="GIALLI" name="PINO" id="56778" />
<emp familyname="ARANCIONE" name="MARIA" id="12345" />
<emp familyname="BLU" name="ALDA" id="67891" />
<emp familyname="VIOLA" name="BRUNA" id="65432" />
<emp familyname="NERO" name="GINA" id="58971" />
<emp familyname="GRIGI" name="PINA" id="56778" />
<emp familyname="GINI" name="ARIANNA" id="12345" />
<emp familyname="TINI" name="SANDRA" id="67891" />
<emp familyname="ROSETTI" name="PAOLA" id="65432" />
<emp familyname="VALENTINI" name="RINO" id="58971" />
<emp familyname="ARMANI" name="SERGIO" id="56778" />
<emp familyname="GIACOMINI" name="OSCAR" id="12345" />
<emp familyname="BIONDI" name="GIUSEPPE" id="67891" />
<emp familyname="BRUNELLI" name="ROCCO" id="67891" />
<emp familyname="VERDINI" name="GIORGIO" id="67891" />
<emp familyname="SIMONI" name="SERENA" id="67891" />
</emps>
</turns>

XSL
<?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:eek:utput method="xml" version="1.0" omit-xml-
declaration="no" indent="yes" />
<xsl:template match="turns">
<fo:root
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-
name="simpleA4" page-width="21cm" page-height="29.7cm" margin-
top="0.5cm" margin-bottom="0.5cm" margin-left="0.5cm" margin-
right="0.5cm">
<fo:region-body margin-
top="0.5cm" margin-bottom="0.5cm" />
<fo:region-before
extent="0.5cm" />
<fo:region-after
extent="0.5cm" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-
reference="simpleA4">
<fo:static-content flow-name="xsl-
region-before">
<fo:block font-
family="Helvetica" font-size="8pt" font-weight="bold" text-align="left">
DIPENDENTI
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-
body">
<xsl:apply-templates
select="emps" />
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="emps">
<fo:table table-layout="fixed" inline-progression-
dimension.maximum="100%" table-omit-footer-at-break="true" table-omit-
header-at-break="true">
<fo:table-column column-width="proportional-
column-width(50)" />
<fo:table-column column-width="proportional-
column-width(50)" />
<fo:table-body>

<xsl:for-each select="emp">
<fo:table-row>
<fo:table-cell
border-width="0.4pt" border-top-style="solid" display-align="before">

<fo:block padding="0.5pt" text-align="right" font-
weight="bold" >

<xsl:value-of select="position()" />

) Family Name

</fo:block>
</fo:table-cell>
<fo:table-cell
border-width="0.4pt" border-top-style="solid" display-align="before">

<fo:block padding="0.5pt" text-align="left">

<xsl:value-of select="@familyname" />

</fo:block>
</fo:table-cell>

</fo:table-row>
<fo:table-row>
<fo:table-cell
border-width="0.0pt" display-align="before">

<fo:block padding="0.5pt" text-align="right" font-
weight="bold" >

Name

</fo:block>
</fo:table-cell>

<fo:table-cell
border-width="0.0pt" display-align="before">

<fo:block padding="0.5pt" text-align="left">

<xsl:value-of select="@name" />

</fo:block>
</fo:table-cell>


</fo:table-row>
<fo:table-row>
<fo:table-cell
border-width="0.4pt" border-bottom-style="solid" display-align="before">

<fo:block padding="0.5pt" text-align="right" font-
weight="bold" >

ID

</fo:block>
</fo:table-cell>

<fo:table-cell
border-width="0.4pt" border-bottom-style="solid" display-align="before">

<fo:block padding="0.5pt" text-align="left">

<xsl:value-of select="@id" />

</fo:block>
</fo:table-cell>

</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</xsl:template>
</xsl:stylesheet>








Inviato da www.mynewsgate.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top