Controlling page-master-selection
Mejlholm Harald <[email protected]> Tue, 22 Apr 2003 14:06:07 +0200
| Newsgroups | gmane.text.xml.xsl.general |
|---|---|
| Message-ID | <00447476B925D51198E000508B6F0DDC08BF3B06@WMSI000272> |
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=3D"rest-pages" ...>
<fo:region-before extent=3D"060.0mm"/>
<fo:region-after region-name=3D"rest-footer" extent=3D"100.0mm"
display-align=3D"after"/>
<fo:region-body margin-top=3D"060.0mm" margin-bottom=3D"100.0mm"/>
</fo:simple-page-master>
<fo:simple-page-master master-name=3D"last-page" ...>
<fo:region-before extent=3D"060.0mm"/>
<fo:region-after region-name=3D"last-footer" extent=3D"100.0mm"
display-align=3D"after"/>
<fo:region-body margin-top=3D"060.0mm" margin-bottom=3D"100.0mm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name=3D"A4">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference=3D"rest-pa=
ges"
page-position=3D"first"/>
<fo:conditional-page-master-reference master-reference=3D"last-pa=
ge"
page-position=3D"last"/>
<fo:conditional-page-master-reference master-reference=3D"rest-pa=
ges"
page-position=3D"rest"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:static-content flow-name=3D"rest-footer">
...
</fo:static-content>
<fo:static-content flow-name=3D"last-footer">
...
</fo:static-content>
<fo:flow flow-name=3D"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 befor=
e
"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=3D"last-page"
page-position=3D"last"/>
<fo:conditional-page-master-reference master-reference=3D"rest-pages"
page-position=3D"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 =C5byh=F8j
Tel: +45 45822200 Dir: +45 87444425
Fax: +45 87444487
MUSIC-supporttel: +45 87444600
mailto:[email protected]
http://www.wmdata.dk