Re: [xsl] Trouble positioning "fo:block" at the bottom of the page

Subject: Re: [xsl] Trouble positioning "fo:block" at the bottom of the page
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 07 Feb 2011 07:58:29 -0500
At 2011-02-07 10:25 +0100, Struijk, Toon van der wrote:
First of all, I must 'warn' you; I'm very new to XSL-FO.

Welcome!


...
I want a piece of text (sort of final notes in a brochure) to appear at the bottom of the last page if that page has room for it. If there is no room for it, I want it to appear at the next page, but also at the bottom of it. This means that when the regular content of the brochure has reached the end, I add the 'final notes'.
...
By the way, I don't know how much content goes in the regular content and how much goes in the 'extrainfo' or 'final notes'. So I cannot work with strict mathematics.

Then I think an approach using static content on the last page will not work.


Any help on my question would be greatly appreciated. And if someone needs to see more code or whatever, please let me know.

Your situation is quite common. This might be a legal disclaimer at the end of a financial report.


The approach I suggest to my students is to drop a footnote at the end of the content. To address your requirement that the content not break over a page, wrap that footnote content with a keep.

The example below works just fine for me when I use Antenna House. The entire notes section is on the second page. As you delete test lines from the first page, when the notes section fits on the first page it ends up there.

Being new to XSL-FO, you may not be aware of the diagnostic approach of simply hand-editing an XSL-FO file in order to determine how constructs you are interested in will work (or not work!). There is no XSLT in the example below. Simply edit the raw XSL-FO and run it through whatever processor you are using. When you have determined what XSL-FO will work for you, then you worry about the XSLT to get you there.

I hope this helps.

. . . . . . . . . . . . Ken

<?xml version="1.0" encoding="US-ASCII"?><!--toon.fo-->
<root xmlns="http://www.w3.org/1999/XSL/Format";
      font-family="Times" font-size="20pt">

  <layout-master-set>
    <simple-page-master master-name="frame"
                        page-height="297mm" page-width="210mm"
                        margin-top="15mm" margin-bottom="15mm"
                        margin-left="15mm" margin-right="15mm">
      <region-body region-name="frame-body"/>
    </simple-page-master>
  </layout-master-set>

  <page-sequence master-reference="frame">
    <flow flow-name="frame-body">
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>This is a test</block>
      <block>
        <footnote>
          <inline/>
          <footnote-body>
            <block keep-together.within-column="always">
This is the text of the extra notes.  It is indeterminate in length and can
cover a number of lines.
This is the text of the extra notes.  It is indeterminate in length and can
cover a number of lines.
This is the text of the extra notes.  It is indeterminate in length and can
cover a number of lines.
            </block>
          </footnote-body>
        </footnote>
      </block>
    </flow>
  </page-sequence>
</root>


-- Contact us for world-wide XML consulting & instructor-led training Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread