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

Re: [XSL-FO] automatic page-layout depending on table-width?

Expand Messages
  • G. Ken Holman
    ... The page geometry cannot be changed based on the *rendered* width, nor can raw XSLFO give you the option to switch geometries in the middle of a page
    Message 1 of 2 , Mar 21, 2002
      At 2002-03-21 13:48 +0100, Wesseler, Frank wrote:
      >I was wondering if there is a way to change the page-layout depending on the
      >width of a table.
      >At the moment the page-layout is portrait and the table is cut on the right
      >site of the page. I want the page-layout to be changed to landscape if the
      >table-width is too large just for this site of a large catalog.

      The page geometry cannot be changed based on the *rendered* width, nor can
      raw XSLFO give you the option to switch geometries in the middle of a page
      sequence based on a single construct.

      To use only XSLFO, you would have to walk through your structure capturing
      everything up to the wide table in one page sequence, put the wide table in
      its own page sequence of landscape geometry, and then put the rest of the
      content in a follow-up page sequence. This can be very awkward to write.

      This is something I had to do, but I tackled it in a two-step fashion in
      order to allow me to write my stylesheet in a hierarchical fashion as XSLT
      was designed for.

      I conceived a new semantic for interleaving page sequence master references
      in XSLFO page sequences, created a one-element vocabulary to represent that
      semantic, and a stylesheet to interpret that semantic to produce a pure
      XSL-FO result.

      It happens I just published this free resource earlier this week (copied


      >Any idea?

      If you can make the decision at XSLT time, then consider the use of our
      free resource (see the resource library linked from our home page below).

      If you need to make the decision at rendering time, then I can't help you.

      Good luck!

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

      p.s. unfortunately our web site has been down for 18 hours ... we hope it
      will be up again soon.

      From: "G. Ken Holman" <gkholman@...>
      Date: Mon, 18 Mar 2002 19:22:41 -0500
      Subject: [XSL-FO] Ann: PSMI - Interleaving geometry in XSLFO page sequence

      We are pleased to announce a free resource that may make XSLFO stylesheet
      writing easier for you in a very specific situation that would otherwise be
      very awkward to accommodate. Not many people will need this, but we feel
      it will be very helpful to anyone who does.

      In my work with landscape tables in XSLFO, I found myself constricted by
      the packaging of top-level block constructs inside of XSLFO page sequences
      because I needed to change the geometry of the page from portrait to
      landscape based on a single construct being placed in the flow of a
      portrait-oriented page sequence.

      It can be done without any kind of extension or customized semantic, but
      consider the difficulty writing XSLT to process deeply nested structure
      where one construct deep within the structure (the landscape table)
      requires a different page geometry than the remainder of the document.

      Rather than try and implement a recursive hunt of called named templates
      through nested structure down until the preceding sibling of the changed
      page geometry, packaging all that in a page sequence, processing the
      changed page geometry in a standalone page sequence and then hunting down
      again the next package of top-level constructs for the old page geometry, I
      felt a two-stage process would be a lot easier to write, debug, understand,
      and maintain.

      The Page Sequence Master Interleave (PSMI) semantic and vocabulary allows
      one to add inside a page sequence flow the interleaving of other page
      geometries for top-level constructs. The PSMI stylesheet then unbundles
      the original page sequence into as many sibling page sequences as is
      required to accommodate the interleaved requests for different page
      geometries. This relieves the stylesheet writer from having to do it while
      navigating nested structure.

      Please find this resource and a more detailed description by going to our
      Resource Library (third link from the top of our home page noted
      below). We've made this a public resource for anyone to use. If you have
      any bugs to report or suggestions for us to consider, we would be pleased
      to hear from you.


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

      Upcoming: 3-days XSLT/XPath and/or 2-days XSLFO: June 17-21, 2002
      - : 3-days XML Information Modeling: July 31-August 2, 2002

      G. Ken Holman mailto:gkholman@...
      Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
      Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995)
      ISBN 0-13-065196-6 Definitive XSLT & XPath
      ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath
      ISBN 1-894049-07-1 Practical Formatting Using XSLFO
      XSL/XML/DSSSL/SGML/OmniMark services, books(electronic, printed),
      articles, training(instructor-live,Internet-live,web/CD,licensed)
      Next public training: 2002-04-08,09,10,11,05-06,07,09,10,13,20,
      - 06-04,07,10,11,13,14,17,20,07-31
    Your message has been successfully submitted and would be delivered to recipients shortly.