Keeping together a text line with the first row in a table

I use a Perl script to generate a fo file out of a non-standard csv
format. The structure is one line of text, and then a table with several
rows, then one line of text, and a new table and so on. The single lines
of text is actually a heading, and should not go to the bottom line of a
page. Instead, it should go to a new page.

To generate the PDF output, I use fop version 0.95 on a Fedora Linux
system.

The fo file structure looks like the following:

<?xml version="1.0" encoding="ISO-8859-1"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
  font-family="Helvetica" font-size="18pt">
   <fo:layout-master-set>
     <fo:simple-page-master master-name="A4-landscape"
      reference-orientation="90" page-width="21cm"
      page-height="29.7cm"
      margin-left="2cm" margin-right="1cm" margin-top=".5cm" margin-bottom="2cm">
      <fo:region-body margin-top=".5cm"/>
      <fo:region-before extent="0cm"/>
      <fo:region-after extent=".5cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>

  <fo:page-sequence master-reference="A4-landscape">
    <fo:static-content flow-name="xsl-region-after">
      <fo:block text-align-last="right" font-size="10pt">
	<fo:page-number />
      </fo:block>
    </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
      <fo:block font-weight="bold">The first hading</fo:block>

      <fo:table table-layout="fixed" width="100%" border-width=".5mm" border-style="dotted">
	<fo:table-column column-width="2cm" />
	<fo:table-column column-width="10cm" />
	<fo:table-column column-width="8cm" />
	<fo:table-column column-width="5cm" />
	<fo:table-body>

	<fo:table-row>
	  <fo:table-cell padding=".5mm" border-width=".5mm"
	      border-style="dotted" text-align="center">
	    <fo:block>1</fo:block>
	  </fo:table-cell>
	  <fo:table-cell padding=".5mm" border-width=".5mm" border-style="dotted">
	    <fo:block>John Johnsen</fo:block>
	  </fo:table-cell>
          <fo:table-cell padding=".5mm" border-width=".5mm" border-style="dotted">
            <fo:block>NOR-Oslo</fo:block>
	  </fo:table-cell>
		    <fo:table-cell padding=".5mm" border-width=".5mm"
		    border-style="dotted" text-align="right">
		      <fo:block>30.40</fo:block>
		    </fo:table-cell>
	</fo:table-row>

	<fo:table-row>
	  <fo:table-cell padding=".5mm" border-width=".5mm"
	      border-style="dotted" text-align="center">
	    <fo:block>2</fo:block>
	  </fo:table-cell>
	  <fo:table-cell padding=".5mm" border-width=".5mm" border-style="dotted">
	    <fo:block>Jack Jacksen</fo:block>
	  </fo:table-cell>
          <fo:table-cell padding=".5mm" border-width=".5mm" border-style="dotted">
            <fo:block>NOR-Oslo</fo:block>
	  </fo:table-cell>
		    <fo:table-cell padding=".5mm" border-width=".5mm"
		    border-style="dotted" text-align="right">
		      <fo:block>39.30</fo:block>
		    </fo:table-cell>
	</fo:table-row>
	</fo:table-body>
      </fo:table>

      <fo:block font-weight="bold">The second heading</fo:block>

And then, a new table. ...

How can I keep together the heading with the first row in the table?

Regards,
Lars

Received on Wednesday, 13 April 2011 14:25:34 UTC