W3C home > Mailing lists > Public > www-xsl-fo@w3.org > September 2003

Re: add a text block at 3rd page of a sequence

From: G. Ken Holman <gkholman@CraneSoftwrights.com>
Date: Wed, 03 Sep 2003 08:32:42 -0400
Message-Id: <>
To: www-xsl-fo@w3.org

At 2003-09-03 14:09 +0200, Christoph Rupp wrote:
>i am really sorry - i have written more than 2000 lines in my .fo script 
>in the last 3 days (and nights) but i just don't understand Ken's and your 
>reply (apart from that script i am still a fo-newbie, btw).
>   <fo:page-sequence-master master-name="seq01">
>     <fo:repeatable-page-master-reference master-reference="chap01"
>           maximum-repeats="2" />
>     <fo:single-page-master-reference master-reference="chap01_PAGE3" />
>     <fo:repeatable-page-master-reference master-reference="chap01" />
>   </fo:page-sequence-master>
>OK - i want to add a block-container in chap01_PAGE3. But how?

By creating unique region names for the regions of chap01_PAGE3 and 
describing the static content that belongs in that specially named region.

>I can add it to the page-sequence, but not to chap01_PAGE3 itself! But if 
>i add it to the page-sequence, then it would appear on *every* page in seq01.

Only if you use the same region names on all your page masters, which 
defeats the purpose.

>The only way i can see is to create three sequences:

Then you are missing a critically important concept in XSL-FO.

>I hope/guess that this has such a simple solution that i can't see it.

It is very simple.

You only need *one* page sequence, and you point that page sequence to the 
page sequence master that utilizes two page geometries as quoted in the 
reply up above.

Determine in which region you want your special content on page 3.  Ensure 
that the simple-page-master for "chap01_PAGE3" has a *different* region 
name for that region than you use for that region in the simple-page-master 
for "chap01".  In your <page-sequence> define the static content for that 
specially named region that only appears in the "chap01_PAGE3" geometry.

The formatter will flow all of the content for your one page sequence to 
your sequence of pages utilizing "chap01" for the first two pages, then 
discovering for the third page that it needs the different "chap01_PAGE3" 
page geometry, then discovering that it needs your static content in that 
specially named region on that page geometry, and you get your static 
content on that page.  When the flow moves along to page 4 it goes back to 
obtaining the "chap01" page geometry.

Because you have named the region *only* on a geometry that is used *only* 
on page 3, your static content will show up on only one page.

A couple of times you have mentioned using a block-container ... this block 
container would not be mutually exclusive with the region body ... I hope 
you weren't expecting that placing that block container on the page would 
automatically cause flowed content in the body to go "around" it.  That 
isn't defined in XSL-FO.  You will need to keep your differences in your 
page 3 limited to the static regions.

I hope this helps.

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

p.s. three weeks from tomorrow I will be in Europe teaching all of this 
publicly in a two-day XSL-FO course that follows a three-day XSLT course 
... please see our home page for the links to the venue and more 
information (English instructions are at the bottom of the linked page).

Next public European delivery:  3-day XSLT/2-day XSL-FO 2003-09-22
Instructor-led on-site corporate, government & user group training
for XSLT and XSL-FO world-wide:  please contact us for the details

G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/f/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6                       Definitive XSLT and XPath
ISBN 0-13-140374-5                               Definitive XSL-FO
ISBN 1-894049-08-X   Practical Transformation Using XSLT and XPath
ISBN 1-894049-11-X               Practical Formatting Using XSL-FO
Member of the XML Guild of Practitioners:     http://XMLGuild.info
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/f/bc
Received on Wednesday, 3 September 2003 08:33:00 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:28 UTC