Controlling page-master-selection

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 UTC