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

Re: [XSL-FO] Footer branching

Expand Messages
  • G. Ken Holman
    ... This last step isn t needed, just create two markers in the flow for every element, one for the first footer and one for the second. As you create the
    Message 1 of 2 , Apr 20, 2004
      At 2004-04-20 19:54 +0000, Jason wrote:
      >I've gotten help here in the past on rolling footers, using markers.
      >But now I have a similar, but diffierent problem, and markers don't
      >seem to help.
      >
      >I have two different footer templates. The layout of the templates are
      >different, and I need to switch back and forth between them as I
      >process the xml, based on the value of an element.
      >
      >I tried creating a marker, and storing the value of the element there.
      >Then the createFooter template retrieves the marker, and checks its
      >value, then calls the appropriate footer template.

      This last step isn't needed, just create two markers in the flow for every
      element, one for the first footer and one for the second. As you create
      the flow, be prepared for both.

      The first footer in the first page geometry will only retrieve the first,
      and the second will only retrieve the second.

      It is *very* common to seed the flow with multiple markers for different
      candidate retrievals since one never knows when or where the retrieval will
      happen. In the print rendition of my XSLT and XSL-FO books, the running
      section number is in the head, and on the left page the section number
      precedes the section title, while on the right page the section number
      follows the section title. There is no way of knowing which one is needed,
      so at every section *both* markers are defined _just in case_ one of them
      is needed at a page break.

      XSL-FO is *full* of contingencies ... in your case here, just set up to be
      prepared for two contingencies and one of them will be needed (you just
      don't know which one).

      >The problem, as I understand it, is that the template it stored as a
      >fo:block, so it isn't really something I can evaluate the value of. At
      >least, when I try that, it doesnt work.

      Correct ... XSLT happens *long* before XSL-FO is interpreted.

      >Is there a way to have a variable that acts the same way a marker works?

      Not necessary ... try to get away from "real-time XSL-FO evaluation" and
      change your mindset to "fill the flow chock full of contingencies for all
      possible situations".

      I hope this helps.

      ............................ Ken

      --
      Public courses: Spring 2004 world tour of hands-on XSL instruction
      Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO
      Hong Kong May 17-21; Bremen Germany May 24-28; Helsinki June 14-18

      World-wide on-site corporate, govt. & user group XML/XSL 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 Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
    Your message has been successfully submitted and would be delivered to recipients shortly.