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

Controlling page-master-selection

From: Mejlholm Harald <hamej@wmdata.com>
Date: Tue, 22 Apr 2003 14:06:07 +0200
Message-ID: <00447476B925D51198E000508B6F0DDC08BF3B06@WMSI000272>
To: "'www-xsl-fo@w3.org'" <www-xsl-fo@w3.org>

I have a XSL-FO-job (an invoice with a giro card on the last page), where I
have to have one type of content in the footer (region-after) of the last
page and another content on the other pages - including the first, but if
the first page is also the last page, it must of course have footer like a
last page.

I have made the following construct:

 <fo:layout-master-set>
   <fo:simple-page-master master-name="rest-pages" ...>
      <fo:region-before extent="060.0mm"/>
      <fo:region-after region-name="rest-footer" extent="100.0mm"
display-align="after"/>
      <fo:region-body margin-top="060.0mm" margin-bottom="100.0mm"/>
   </fo:simple-page-master>
   <fo:simple-page-master master-name="last-page" ...>
      <fo:region-before extent="060.0mm"/>
      <fo:region-after region-name="last-footer" extent="100.0mm"
display-align="after"/>
      <fo:region-body margin-top="060.0mm" margin-bottom="100.0mm"/>
    </fo:simple-page-master>
   <fo:page-sequence-master master-name="A4">
      <fo:repeatable-page-master-alternatives>
        <fo:conditional-page-master-reference master-reference="rest-pages"
page-position="first"/>
        <fo:conditional-page-master-reference master-reference="last-page"
page-position="last"/>
        <fo:conditional-page-master-reference master-reference="rest-pages"
page-position="rest"/>
      </fo:repeatable-page-master-alternatives>
   </fo:page-sequence-master>
 </fo:layout-master-set>

  <fo:static-content flow-name="rest-footer">
    ...
  </fo:static-content>
  <fo:static-content flow-name="last-footer">
    ...
  </fo:static-content>
  <fo:flow flow-name="xsl-region-body">
    ...
  </fo:flow>


Running this puts last-page-footer on all (of f.ex. 5) pages except the
first, and if the document has only 1 page, I do not get the last
page-footer. Switching the first- and last
conditional-page-master-reference-lines above, so that "last" comes before
"first", gives me last page-footer on all pages.

I have also tried a simpler alternative with only 2
repeatable-page-master-alternatives:

  <fo:conditional-page-master-reference master-reference="last-page"
page-position="last"/>
  <fo:conditional-page-master-reference master-reference="rest-pages"
page-position="any"/>

since my understanding is, that alternatives are parsed top-down and the
first with matching criterias is selected. But this dones'nt give the
desired result either: I get last page-footer on all pages no matter the
number of pages.

Can anybody help me with this? I am using fop-version 0.20.3


Hilsen/Regards

Harald Mejlholm

WM-data
Hermodsvej 22
DK-8230 Åbyhøj
Tel:   +45 45822200  Dir: +45  87444425
Fax:  +45 87444487
MUSIC-supporttel: +45 87444600
mailto:hamej@wmdata.com
http://www.wmdata.dk
Received on Tuesday, 22 April 2003 08:09:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:10 GMT