[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Problems with page-position="only" and FOP 0.95

Subject: Problems with page-position="only" and FOP 0.95
From: Mark Anderson <mark.anderson@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 10 Mar 2010 00:49:23 +0000
 Problems with page-position="only" and FOP 0.95
Hi All

I'm in the process of testing various FO Processors. I created some test
files, one of which was a single page invoice and a multi-page invoice. The
first page has a full header and remaining pages have a small headers (logo
only). The last page has a big footer with totals. If the invoice only has a
few lines then the big footer needs to go on page 1 (so first page header and
last page footer). To accomplish this I use a conditional page-master with the
page-position="only" trait.

It works fine for multi-page invoices in Antenna House and XEP, but in FOP, I
get the "only" layout for every page. This was supposed to be fixed in FOP
0.92, but still doesn't seem to work. Below is a snippet from my XSL:

<xsl:template match="/tg_invoice">
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

      <fo:layout-master-set>
        <!-- Define all page masters here -->
        <fo:page-sequence-master master-name="contents_sequence">
          <!-- Define sequence. First page will be "cover", next page will be
"continuation" -->
          <fo:repeatable-page-master-alternatives>
            <!-- List of page masters that will be selected according the
result of the page-position trait -->
            <fo:conditional-page-master-reference page-position="only"
master-reference="single"/>
            <fo:conditional-page-master-reference page-position="first"
master-reference="cover"/>
            <fo:conditional-page-master-reference page-position="rest"
master-reference="continuation"/>
            <fo:conditional-page-master-reference page-position="last"
master-reference="last"/>
          </fo:repeatable-page-master-alternatives>
        </fo:page-sequence-master>

        <!-- Layout for single page invoices -->
        <fo:simple-page-master master-name="single" page-height="29.7cm"
page-width="21cm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm"
margin-right="1cm">
          <fo:region-body margin-top="9cm" margin-bottom="3cm"/>
          <fo:region-before region-name="header_first" extent="9cm"/>
          <fo:region-after region-name="footer_last" extent="3cm"/>
        </fo:simple-page-master>
        <!-- End -->

        <!-- Layout for first page -->
        <fo:simple-page-master master-name="cover" page-height="29.7cm"
page-width="21cm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm"
margin-right="1cm">
          <fo:region-body margin-top="9cm" margin-bottom="1cm"/>
          <fo:region-before region-name="header_first" extent="9cm"/>
          <fo:region-after region-name="footer_rest" extent="1cm"/>
        </fo:simple-page-master>
        <!-- End -->

        <!-- Layout for subsequent pages -->
        <fo:simple-page-master master-name="continuation" page-height="29.7cm"
page-width="21cm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm"
margin-right="1cm">
          <fo:region-body margin-top="3cm" margin-bottom="1cm"/>
          <fo:region-before region-name="header_rest" extent="3cm"/>
          <fo:region-after region-name="footer_rest" extent="1cm"/>
        </fo:simple-page-master>
        <!-- End -->

        <!-- Layout for last page -->
        <fo:simple-page-master master-name="last" page-height="29.7cm"
page-width="21cm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm"
margin-right="1cm">
          <fo:region-body margin-top="3cm" margin-bottom="3cm"/>
          <fo:region-before region-name="header_rest" extent="2cm"/>
          <fo:region-after region-name="footer_last" extent="3cm"/>
        </fo:simple-page-master>
        <!-- End -->
      </fo:layout-master-set>
      <!-- End page masters -->

Does the above look correct?

M a r k 

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.