[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] fo:multi-switch or alternative

Subject: Re: [xsl] fo:multi-switch or alternative
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 25 Sep 2012 16:33:51 -0400

At 2012-09-25 22:12 +0200, Jesper Tverskov wrote:
I want to do something like the following:

When a fo:block A in a flow appears not on page one, where it normally
goes, but on page two, fo:block B on page 1 should be made visible,
and fo:block C on page 1 should no longer be visible.

This can likely be done with markers retrieved in a border-less table header.

I don't know if something like the above can be achieved with
fo:multi-switch, and I don't know what FOP processors support
fo:multi-switch? Apache FOP?

That is not the role of multi-switch, which is reserved for use in an interactive FO presentation, not a static FO presentation. I don't know of any vendors supporting interactive FO presentation. The multi-switch is there to avoid a lot of scripting such as that found in expanding/collapsing tables of content.

Or are there other ways the above can be achieved?

Flowing markers on the page might work for you.

I have a feeling that it is not at all possible in XSL-FO alone. It is
impossible to make use of information that is first available when the
formatting has taken place? Some trick is probably necessary?

I need a little help and some hints before I start experimenting for real.

You don't give a working example to play with, but something like the following pseudo structure may work:

  table - table-omit-header-at-break="true"
        retrieve B
        retrieve C
          define marker "B" with block B
          define marker "C" as empty (redundant, but helps maintenance)
        block A
          define marker "B" as empty
          define marker "C" with block C

My thought above is that if the table end is on the same page as the table start, then "B" is emptied out and "C" is displayed. However, if the table extends over the end of the page, then "B" is displayed and "C" is empty. The omission of the header on page break means that neither will show up on the next page.

I hope this works for you.

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

-- Contact us for world-wide XML consulting and instructor-led training Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread