Creating Page Sequences: fo:page-sequence

Creating Page Sequences: fo:page-sequence

The pages in the output document are actually created when the XSL processor processes fo:page-sequence objects. A page sequence consists of a run of pages that share the same characteristics, such as a chapter in a book.

Each fo:page-sequence object references either a fo:page-sequence-master or a page master, and the actual layout of the pages is specified by those masters. You can get fairly involved here, creating sequences in which the page numbering alternates from side to side on the page as when you're creating pages for a book. Here are the properties that apply to the fo:page-sequence object:

  • country

  • format

  • language

  • letter-value

  • grouping-separator

  • grouping-size

  • id

  • initial- page-number

  • force-page-count

  • master- name

In the current W3C XSL recommendation, you specify what page master you want to use for a page sequence with the <fo:page-sequence> element's master-reference attribute. I named the simple page master we created page , so I'll set that attribute to that name here:

 <?xml version='1.0'?>  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"     xmlns:fo="http://www.w3.org/1999/XSL/Format"     version='1.0'>     <xsl:template match="PLANETS">         <fo:root>             <fo:layout-master-set>                  <fo:simple-page-master master-name="page"                      page-height="400mm" page-width="300mm"                      margin-top="10mm" margin-bottom="10mm"                      margin-left="20mm" margin-right="20mm">                      <fo:region-body                        margin-top="0mm" margin-bottom="10mm"                        margin-left="0mm" margin-right="0mm"/>                      <fo:region-after extent="10mm"/>                  </fo:simple-page-master>              </fo:layout-master-set>  <fo:page-sequence master-reference="page">  .                  .                  . 

That specifies what page master we want to use for a page sequence. Next, you have to specify the content of the page sequence. And the content of these pages comes from flow children of the fo:page-sequence .



Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

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