Loading ...
Sorry, an error occurred while loading the content.

7258Re: [XSL-FO] Conditionally displaying a footer

Expand Messages
  • G. Ken Holman
    Sep 5, 2006
    • 0 Attachment
      At 2006-09-05 13:23 +0000, jpcm24 wrote:
      >I have a requirement to display the footer details (company name,
      >underwriter details etc)in the following manner:
      >1.) Cover letter only on 1 side of sheet (even side blank) display
      >footer on page 1
      >2.) Cover letter flows onto even side - display the footer details
      >on the even sheet.
      >
      >Currently, the footer region is defined within the first-after
      >region, in a block.
      >
      >Is it possible to conditionally display the footer if the main body
      >(within the flow) overflows to the even side?
      >
      >A couple of ideas I have are:
      >a.)Have different simple-page-masters for the first-even (one with a
      >footer, one without a footer)

      Yes, you need that.

      >and determine which one to use.

      But you can't "determine" you can only "prepare" to use each one.

      >b.) Determine whether the flow has gone onto the even side (blank-or-
      >nat-blank maybe) and determine whether to display the first-after,
      >or blocks.

      There is no "determination" in XSL-FO ... only
      contingencies. You set up your stylesheet in
      such a way that the resulting XSL-FO has
      contingencies for the situations the formatter
      finds itself in when flowing the information.

      Your first page is clear.

      Your second page is a choice, so you order the
      alternatives in the tested order such that you
      get what you want when the first in the order
      tests true for the condition in which the
      formatter finds itself after the flow.

      So, you need something like:

      <page-sequence-master master-name="pages">
      <single-page-master-reference master-reference="cover-odd"/>
      <repeatable-page-master-alternatives maximum-repeats="1">
      <conditional-page-master-reference master-reference="page-blank"
      blank-or-not-blank="blank"/>
      <conditional-page-master-reference master-reference="cover-even"/>
      </repeatable-page-master-alternatives>
      <repeatable-page-master-alternatives>
      <conditional-page-master-reference odd-or-even="even"
      master-reference="page-even"/>
      <conditional-page-master-reference odd-or-even="odd"
      master-reference="page-odd"/>
      </repeatable-page-master-alternatives>
      </page-sequence-master>

      Note in the above that you always get a second
      page, but if the page has flow you get the page
      geometry that has your footer, otherwise you get
      the page geometry that shows the blank page.

      The formatter then chooses the page geometry from
      these contingencies ... there is no
      "determination" going on by the XSLT stylesheet,
      only by the formatter amongst the choices you have provided.

      I hope this helps.

      . . . . . . . . . Ken

      --
      UBL/XML/XSLT/XSL-FO training: Vårø, Denmark 2006-10-02/06,11-20/24
      UBL International 2006 2006-11-13/17 http://www.ublconference.com
      World-wide corporate, govt. & user group UBL, XSL, & XML training.
      G. Ken Holman mailto:gkholman@...
      Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
      Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
      Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/f/bc
      Legal business disclaimers: http://www.CraneSoftwrights.com/legal
    • Show all 2 messages in this topic