473,626 Members | 3,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XSL:FO page break

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="windo ws-1252"?>
<?xml-stylesheet href="XSL/ppt.xsl" type="text/xsl"?>
<turns>
<emps>
<emp familyname="ROS SI" name="MARIO" id="12345" />
<emp familyname="NER I" name="ALDO" id="67891" />
<emp familyname="BIA NCHI" name="BRUNO" id="65432" />
<emp familyname="VER DI" name="GINO" id="58971" />
<emp familyname="GIA LLI" name="PINO" id="56778" />
<emp familyname="ARA NCIONE" name="MARIA" id="12345" />
<emp familyname="BLU " name="ALDA" id="67891" />
<emp familyname="VIO LA" name="BRUNA" id="65432" />
<emp familyname="NER O" name="GINA" id="58971" />
<emp familyname="GRI GI" name="PINA" id="56778" />
<emp familyname="GIN I" name="ARIANNA" id="12345" />
<emp familyname="TIN I" name="SANDRA" id="67891" />
<emp familyname="ROS ETTI" name="PAOLA" id="65432" />
<emp familyname="VAL ENTINI" name="RINO" id="58971" />
<emp familyname="ARM ANI" name="SERGIO" id="56778" />
<emp familyname="GIA COMINI" name="OSCAR" id="12345" />
<emp familyname="BIO NDI" name="GIUSEPPE" id="67891" />
<emp familyname="BRU NELLI" name="ROCCO" id="67891" />
<emp familyname="VER DINI" name="GIORGIO" id="67891" />
<emp familyname="SIM ONI" name="SERENA" id="67891" />
</emps>
</turns>

XSL
<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et 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: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="simp leA4">
<fo:static-content flow-name="xsl-
region-before">
<fo:block font-
family="Helveti ca" 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.maxim um="100%" table-omit-footer-at-break="true" table-omit-
header-at-break="true">
<fo:table-column column-width="proporti onal-
column-width(50)" />
<fo:table-column column-width="proporti onal-
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="positio n()" />

) 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="@family name" />

</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
Jul 20 '05 #1
0 3943

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2726
by: David | last post by:
Hello list, I'm using XML + XSL + CSS to display my data to the web. I also want to publish my pages in PDF format. To accomplish this I first must transform my XML + XSL + CSS in XSL-FO. Is there a know technique to transform my data to XSL-FO without loosing my markup. For example, transformation my data to XHTML first and later from XHTML to XSL-FO? Hope someone can help me on this one.
1
1644
by: MArc Baumgartner | last post by:
Hello all, I have got a Question about XSL:FO: A XML-File contains any customers. For every customer I have to generate a letter. This letter can contain - depending on the information about the customer - from 1 to 5 pages. On every page I have to put the relative page number (e.g. 1-5) and the absolute page number (e.g. 456). All letter should be in one
4
5315
by: hilz | last post by:
Hi all: Is there a way to make the <fo:page-number> start from a value different than 1 ? (using fop to generate pdf) thanks hilz
2
11601
by: Anshul Seth | last post by:
I have been dealing with the page-break problem for long, and have not been able to come to a solution. 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. I implemented <keep-together.within-page="always"> in <fo:table row> as FOP0.20.5 does not support it in any other...
0
1417
by: sp | last post by:
Hi, I'm trying to write an xsl-fo document that with fop translate it in PDF. It's all right, but I have a question: There is a manner to indicate to xsl-fo to join together a block section, so that if there is a page break it decide to print the block in the new page to avoid to break the block? Please help me.
0
2422
by: Nathan | last post by:
Hi, I seem to having a peculiar problem with the display of odd and even pages in XSL-FO. Here is a small background of the problem. My xsl stylesheet mentions my fo:layout-master-set as <fo:layout-master-set> <fo:simple-page-master margin-left="0.5in" margin-right="0.5in" page-width="8.5in" margin-bottom="0.5in" master-name="Section-odd-page" margin-top="0.5in" page-height="14in"> <fo:region-after region-name="xsl-region-after-odd"
0
2488
by: jklBruin | last post by:
i'm trying to implement converting xsl-fo to pdf on a .Net page. i''m getting the error message: Root element must be root, not http://www.w3.org/1999/XSL/Transform:stylesheet here's the xsl i'm using. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet
5
5106
by: cleary1981 | last post by:
Hi, Im a little out of my depth using xsl fo here. I have a table of items and each has a price in the second row of the table. I need to display a total at the bottom of the row. My problem is that I can't work out how to perform addition in xsl fo. Here's my xsl file where I have created the table. <!-- Nextpage: Quote --> <fo:block break-before="page" space-before="2in" space-after="2in"> <fo:block...
1
5319
by: cleary1981 | last post by:
Hi, I am trying to add page numbers to my document in xsl fo. I can get the page numbers to work but I need them to show at the bottom of each page. I know you can define an area as region-after but don't know how. Heres my xsl file so far. <?xml version="1.0" encoding="ISO-8859-1" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" ...
0
8268
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8202
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5575
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.