XSL:FO page break

Discussion in 'XML' started by Rary, Jan 19, 2005.

  1. Rary

    Rary Guest

    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
    Rary, Jan 19, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefan Mueller

    How to add a page break to a HTML page

    Stefan Mueller, Mar 9, 2006, in forum: HTML
    Replies:
    2
    Views:
    163,383
    Stefan Mueller
    Mar 10, 2006
  2. Anshul Seth

    XSL:FO page break problem

    Anshul Seth, Jul 8, 2004, in forum: XML
    Replies:
    2
    Views:
    1,168
    legetz
    Aug 4, 2004
  3. Replies:
    0
    Views:
    579
  4. Replies:
    1
    Views:
    3,598
    A. Bolmarcich
    May 27, 2005
  5. Replies:
    12
    Views:
    957
Loading...

Share This Page