7.4 Page geometry sequencing

7.4.1 Patterning the page geometry in a sequence of pages

Every different page geometry must be in a separate simple-page-master construct.

  • Each master is uniquely named.

  • Not all regions utilized in the page sequence need be defined on every page geometry.

A page-sequence defines the flow for a sequence of pages.

  • You can create a new page sequence for a change in static content.

  • You can create a new page sequence to start the flow on a new page.

  • The page sequence utilizes page geometries referenced by the master-reference property.

  • You can force a sequence to create a blank page at end if necessary

    • so the page sequence automatically accommodates the first page number of the following page sequence (default);

      • the following page sequence may be forced to start on an odd or even page number thereby requiring a filler page after the end of the given page sequence,

    • so the total number of pages in the page sequence is an even or odd count,

    • so the last of the page sequence is an even or odd page number.

The simplest case is not to sequence the pages.

  • A page-sequence that points to a simple-page-master repeats that one page for the entire sequence.

A page-sequence-master defines an ordering of sub-sequences of page geometries.

  • A page-sequence that points to a page-sequence-master obtains each page geometry from the specified ordering.

  • The need for new pages in the flow takes the next page geometry from the next ordered sub-sequence in the master.

    • Each page-sequence-master must specify at least one sub-sequence of geometries.

  • The formatter may signal an error if it exhausts available sub-sequences.

    • Otherwise it could just repeat the last sub-sequence.

    • To prevent possible error, a robust stylesheet should provide an infinitely repeatable sub-sequence as the last sub-sequence.

  • Each master is named uniquely and also differently from the page geometry names .

A single required layout-master-set specifies all masters.

  • Both single-page masters and page-sequence masters are specified.

  • There is no semantic order to the set of layout masters.

7.4.2 Page geometry sub-sequences

A sub-sequence defines some or all of the page geometries used in a page sequence.

  • The first page of the flow comes from the first qualifying geometry of the first sub-sequence of the page sequence.

  • When one sub-sequence is exhausted, the next page uses the first qualifying geometry from the next sub-sequence.

A sub-sequence can specify the use of only one geometry.

  • Use single-page-master-reference to use one geometry once.

  • Use repeatable-page-master-reference to use one geometry more than once.

    • It can be unbounded (default) or bounded by a maximum number of repetitions.

A sub-sequence can specify the choice of one of a set of geometries.

  • Use repeatable-page-master-alternatives to collect the set of geometries from which to choose.

  • Use conditional-page-master-reference to specify the choice criteria.

  • Each choice criterion is tested in the document order of choices specified in the set.

    • The first choice where all criteria test true specifies the geometry used for the page of the flow.

  • The set of choices is repeated indefinitely by default.

    • It can be bounded by a maximum number of repetitions.

The choice criteria are made up of three sub-conditions.

  • All three criteria must be true for the choice to be used.

  • An unspecified criterion is considered to be " any " which is true for each test.

    • You only need to specify the criteria desired for uniqueness.

  • All criteria values are unambiguous.

    • It doesn't matter in what order the criteria are specified.

    • Each page tests true for exactly one value for each criterion.

A criterion can be based on the parity of the page number.

  • Use odd-or-even to test the criterion;

  • " any " (initial value) tests true for all pages;

  • " odd " tests true if the page number is odd;

  • " even " tests true if the page number is even.

A criterion can be based on the position of the page within the page sequence.

  • Use page-position to test the criterion;

  • " any " (initial value) tests true for all pages;

  • " first " tests true if the page is the first in the page sequence;

  • " last " tests true if the page is the last in the page sequence;

  • " rest " tests true if the page is neither the first nor the last in the page sequence.

  • Note that a one-page page sequence will test true for both " first " and " last " .

    • This requires the stylesheet writer to decide which of the two possible geometries is desired for a one-page sequence.

    • The tests in the alternatives must be ordered so that the desired geometry is selected for the one-page sequence situation before the undesired geometry would be selected.

A criterion can be based on the page being generated by the flow or not.

  • Use blank-or-not-blank to test the criterion;

  • " any " (initial value) tests true for all pages;

  • " not-blank " tests true if the page contains flow;

  • " blank " tests true if the page does not contain flow because of the page being generated to meet sequence conditions (a "forced" page)

    • e.g. ensuring that the last page of a chapter is on an even page number.

7.4.3 Forced blank pages

A forced blank page is a page not containing any paginated flow, but created by the formatter in response to page sequencing requirements.

  • It is referred to as a "blank page" in a page sequence.

    • This is tested in conditional-page-master-reference using blank-or-not-blank .

  • If no page master is supplied for a blank page, a page with no content is rendered.

  • It is always rendered as the last page in a page sequence.

There are two ways a blank page can be triggered.

  • It may be triggered by the page numbering of the last page in the given page sequence.

    • This is determined by force-page-count ;

    • the values of even , odd , end-on-even , and end-on-odd may require a blank page to be created.

  • It may be triggered by the page numbering of the first page of the following page sequence.

    • A value of auto on the given page sequence will cause a final blank page to be created if the page number of the first page of the following page sequence is explicitly specified and requires a blank page for continuous page numbering;

    • the value of initial- page-number for the following page sequence is taken into account;

    • it is tested for odd or even (including a specified value of "1") forcing the given page sequence to end on even or odd page respectively;

    • sometimes a blank page appears "unexpectedly" whereas the influence of the following page sequence is the actual trigger.

There are four ways a blank page can be triggered by breaking to a new page.

  • You can use break-before="odd-page" or break-after="odd-page" when in the middle of an odd page.

  • You can use break-before="even-page" or break-after="even-page" when in the middle of an even page.

  • It is important to remember the intuitive use of two break-before="page" or break-after="page" blocks in a row does not constitute a blank page for the purposes of geometry testing.

    • It is a " not-blank " page since there is an empty area on the page from the first of the two blocks.

7.4.4 The page-sequence-master object

Purpose
  • This is the definition and name of a particular sequence of using page masters.

Content
  • ( 6.4.7 ) (single-page-master-reference repeatable-page-master-reference repeatable-page-master-alternatives+) ,

  • child objects (listed alphabetically ):

    • repeatable-page-master-alternatives ( 6.4.10 ; 222),

    • repeatable-page-master-reference ( 6.4.9 ; 222),

    • single-page-master-reference ( 6.4.8 ; 221),

  • referring object:

    • layout-master-set ( 6.4.6 ; 65).

Required property
  • master-name ( 7.25.8 ; 393).

Excerpts from a draft XSLT stylesheet for producing a training material are shown in Example 7-6.

The page sequence used in this example prepares to alternately use differently named page masters.

  • Each page master has the same name for the before region and a different name for the after region.

  • The page sequence defines the static content to be rendered for every possible named region in all simple page masters triggered by the page sequence master.

  • Only the static content for the regions that are used on a given page is rendered.

    • Any defined static content for regions that are not on the page is ignored.

The production environment for this example responds to a parameterized request for single-sided copies.

  • For single-sided output, master-reference="frame-right" will be used for both odd and even pages.

    • master-reference="frame-left" is never used, but maintenance of the stylesheets is easy by not having two separate page sequences.

  • For double-sided output, each page geometry will be used accordingly .

Example 7-6 A master of a sequence of pages
 Line 01 <xsl:param name="single-sided"/><!--assume double sided-->      02 <xsl:variable name="use-left"><!--determine left side geometry-->      03   <xsl:choose>      04     <xsl:when test="$single-sided">frame-right</xsl:when>      05     <xsl:otherwise>frame-left</xsl:otherwise>      06   </xsl:choose>      07 </xsl:variable>      08 ...      09 <layout-master-set>      10   <simple-page-master master-name="frame-left" ...>      11     <region-body region-name="pages-body" .../>      12     <region-before extent=".3in" region-name="pages-before"/>      13     <region-after extent=".3in" region-name="pages-after-left"/>      14   </simple-page-master>      15   <simple-page-master master-name="frame-right" ...>      16     <region-body region-name="pages-body" .../>      17     <region-before extent=".3in" region-name="pages-before"/>      18     <region-after extent=".3in" region-name="pages-after-right"/>      19   </simple-page-master>      20       21  <page-sequence-master master-name="frames">  22     <repeatable-page-master-alternatives maximum-repeats="no-limit">      23       <conditional-page-master-reference      24         master-reference="frame-right" odd-or-even="odd"/>      25       <conditional-page-master-reference      26         master-reference="{$use-left}" odd-or-even="even"/>      27     </repeatable-page-master-alternatives>      28  </page-sequence-master>  29 </layout-master-set> 

7.4.5 The single-page-master-reference object

Purpose
  • This is the specification of the single use of a page master within a sequence of page masters.

Content
  • ( 6.4.8 ) EMPTY ,

  • referring object:

    • page-sequence-master ( 6.4.7 ; 220).

Required property
  • master-reference ( 7.25.9 ; 394).

7.4.6 The repeatable-page-master-reference object

Purpose
  • This is the specification of the repeated use of a page master within a sequence of page masters.

Content
  • ( 6.4.9 ) EMPTY ,

  • referring object:

    • page-sequence-master ( 6.4.7 ; 220).

Required property
  • master-reference ( 7.25.9 ; 394).

Optional property
  • maximum-repeats ( 7.25.10 ; 394).

7.4.7 The repeatable-page-master-alternatives object

Purpose
  • This is the collection of candidate page master references from which one is to be used based on status conditions detected by the formatter.

Content
  • ( 6.4.10 ) (conditional-page-master-reference+) ,

  • child object:

    • conditional-page-master-reference ( 6.4.11 ; 223),

  • referring object:

    • page-sequence-master ( 6.4.7 ; 220).

Optional property
  • maximum-repeats ( 7.25.10 ; 394).

Excerpts from a draft XSLT stylesheet for the training material document are shown in Example 7-7.

Example 7-7 A master of a sequence of pages
 Line 01 <xsl:param name="single-sided"/><!--assume double sided-->      02 <xsl:variable name="use-left"><!--determine left side geometry-->      03   <xsl:choose>      04     <xsl:when test="$single-sided">frame-right</xsl:when>      05     <xsl:otherwise>frame-left</xsl:otherwise>      06   </xsl:choose>      07 </xsl:variable>      08 ...      09 <layout-master-set>      10   <simple-page-master master-name="frame-left" ...>      11     <region-body region-name="pages-body" .../>      12     <region-before extent=".3in" region-name="pages-before"/>      13     <region-after extent=".3in" region-name="pages-after-left"/>      14   </simple-page-master>      15   <simple-page-master master-name="frame-right" ...>      16     <region-body region-name="pages-body" .../>      17     <region-before extent=".3in" region-name="pages-before"/>      18     <region-after extent=".3in" region-name="pages-after-right"/>      19   </simple-page-master>      20       21   <page-sequence-master master-name="frames">      22  <repeatable-page-master-alternatives maximum-repeats="no-limit">  23       <conditional-page-master-reference      24         master-reference="frame-right" odd-or-even="odd"/>      25       <conditional-page-master-reference      26         master-reference="{$use-left}" odd-or-even="even"/>      27  </repeatable-page-master-alternatives>  28   </page-sequence-master>      29 </layout-master-set> 

7.4.8 The conditional-page-master-reference object

Purpose
  • This is a page master choice available to the formatter when selecting from a collection of candidate page masters.

Content
  • ( 6.4.11 ) EMPTY ,

  • referring object:

    • repeatable-page-master-alternatives ( 6.4.10 ; 222).

Required property
  • master-reference ( 7.25.9 ; 394).

Optional properties
  • blank-or-not-blank ( 7.25.1 ; 351),

  • odd-or-even ( 7.25.12 ; 396),

  • page-position ( 7.25.14 ; 402).

Excerpts from a draft XSLT stylesheet for the training material are shown in Example 7-8.

Example 7-8 A master of a sequence of pages
 Line 01 <xsl:param name="single-sided"/><!--assume double sided-->      02 <xsl:variable name="use-left"><!--determine left side geometry-->      03   <xsl:choose>      04     <xsl:when test="$single-sided">frame-right</xsl:when>      05     <xsl:otherwise>frame-left</xsl:otherwise>      06   </xsl:choose>      07 </xsl:variable>      08 ...      09 <layout-master-set>      10   <simple-page-master master-name="frame-left" ...>      11     <region-body region-name="pages-body" .../>      12     <region-before extent=".3in" region-name="pages-before"/>      13     <region-after extent=".3in" region-name="pages-after-left"/>      14   </simple-page-master>      15   <simple-page-master master-name="frame-right" ...>      16     <region-body region-name="pages-body" .../>      17     <region-before extent=".3in" region-name="pages-before"/>      18     <region-after extent=".3in" region-name="pages-after-right"/>      19   </simple-page-master>      20       21   <page-sequence-master master-name="frames">      22     <repeatable-page-master-alternatives maximum-repeats="no-limit">      23  <conditional-page-master-reference  24  master-reference="frame-right" odd-or-even="odd"/>  25  <conditional-page-master-reference  26  master-reference="{$use-left}" odd-or-even="even"/>  27     </repeatable-page-master-alternatives>      28   </page-sequence-master>      29 </layout-master-set> 

7.4.9 Overview of a page sequence specification

A complicated (and contrived) page sequence is shown in Figure 7-7.

Figure 7-7. Page sequence specification options

graphics/07fig07.gif

Note there are only two specifications of actual page geometry, while many various sequencing patterns of using these geometries are defined and utilized by the five page sequence specifications.

  • All sub-sequences are composed only of references to page geometries.

7.4.10 Planning a more complex page sequence specification

Figure 7-8 shows how planning ahead helps when considering more complex requirements.

  • Consider planning a book with a table of contents and the contents each starting on the right-hand page.

  • You need different formatting of headers and footers for the TOC and for contents;

    • the TOC only has the page number centered in the footer and an even number of pages in total count (to ensure the content starts on an odd page);

    • other pages have the document title at bottom left of odd pages and bottom right of even pages, and chapter title at top right of odd pages and top left of even pages.

Figure 7-8. Page sequence planning: complex example

graphics/07fig08.jpg



Definitive XSL-FO
Definitive XSL-FO
ISBN: 0131403745
EAN: 2147483647
Year: 2002
Pages: 99
Authors: G. Ken Holman

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net