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

Re: [fo] conditional item in the header of a page

Subject: Re: [fo] conditional item in the header of a page
From: Geert Bormans <geert@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 20 Apr 2009 23:10:07 +0200
Re:  [fo] conditional item in the header of a page
Hi Ken,

Thanks for that, it works really well

Cheers
Geert



At 13:04 20/04/2009, you wrote:
At 2009-04-20 12:24 +0200, Geert Bormans wrote:
In a project I need to add a sign in the header if my page sequence spans multiple pages

Basically I have an fo:page-sequence for every occurrence of an XML element in my source
This page sequence can span multiple pages
In the header, I need to add an arrow symbol
- pointing to the right, if this particular page is not the last one in the sequence
- pointing to the left, if this particular page is not the first one in the sequence


Potentially a page has two arrow symbols in the page header
Possibly a page has no arrows (if the XML element only spans one page

This is handled very straightforwardly by using markers.


Retrieve two markers in your header, one for each of the two arrows. For the left arrow graphic use something like:

  <retrieve-marker retrieve-class-name="leftarrow"
                   retrieve-position="first-including-carryover"/>

For the right arrow graphic use something like:

  <retrieve-marker retrieve-class-name="rightarrow"
                   retrieve-position="last-ending-within-page"/>

At the start of your page sequence, have:

  <block>
    <marker marker-class-name="leftarrow"/>
    <marker marker-class-name="rightarrow">
       .... definition of right arrow ....
    </marker>
  </block>
  <block>
    <marker marker-class-name="leftarrow">
      .... definition of left arrow ....
    </marker>
  </block>
  ... rest of page sequence ...

At the end of your page sequence, have:

  ... rest of page sequence ...
  <block>
    <marker marker-class-name="rightarrow"/>
  </block>

With those definitions, the first page's left arrow is empty, but any page break after reveals the left arrow, and the start of the sequence has a definition of right arrow, but at the very end (there is always room for an empty block), the definition is blanked out. So the definition will be blank at the end of the page sequence.

The above will work on a single-page page-sequence.

I hope this helps (and I haven't mistyped!).

. . . . . . . . . Ken

--
XSLT/XSL-FO/XQuery hands-on training - Los Angeles, USA 2009-06-08
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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.