UP PREVIOUS NEXT   Technologies Internet et Education, © TECFA
  4. Pagination

4. Pagination

Exemple 4-1: Un simple stylesheet XSLT + FO

 <xsl:template match="training-course">
  <xsl:processing-instruction name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>
  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
   <fo:layout-master-set>
       <fo:simple-page-master
 master-name="first"
                  page-height="29.7cm" 
                  page-width="21cm"
                  margin-top="2cm" 
                  margin-bottom="2cm" 
                  margin-left="2.5cm" 
                  margin-right="2.5cm">
      <fo:region-body
 margin-top="3cm"/>
      <fo:region-before
 extent="3cm"/>
      <fo:region-after extent="1.5cm"/>
    </fo:simple-page-master>
 
    <fo:simple-page-master master-name="right"
                  page-height="29.7cm" 
                  page-width="21cm"
                  margin-top="2cm" 
                  margin-bottom="2cm" 
                  margin-left="2.5cm" 
                  margin-right="2.5cm">
      <fo:region-body margin-top="2.5cm"/>
      <fo:region-before extent="2.5cm"/>
      <fo:region-after extent="1.5cm"/>
    </fo:simple-page-master>
 
    <fo:simple-page-master
 master-name="left"
                  page-height="29.7cm" 
                  page-width="21cm"
                  margin-top="2cm" 
                  margin-bottom="2cm" 
                  margin-left="2.5cm" 
                  margin-right="2.5cm">
      <fo:region-body
 margin-top="2.5cm"/>
      <fo:region-before
 extent="2.5cm"/>
      <fo:region-after extent="1.5cm"/>
    </fo:simple-page-master>
 
    <fo:page-sequence-master
 master-name="run">
			<fo:repeatable-page-master-alternatives
 maximum-repeats="no-limit" >
				<fo:conditional-page-master-reference
					master-name="left"
					odd-or-even="even" />
				<fo:conditional-page-master-reference
					master-name="right"
					odd-or-even="odd" />
				<fo:conditional-page-master-reference
					master-name="title"
					 />
			</fo:repeatable-page-master-alternatives>
   </fo:page-sequence-master>
 
 </fo:layout-master-set>
  <!-- end: defines page layout -->
 
<!-- actual layout -->
  <fo:page-sequence
 master-name="run" initial-page-number="1">
 
   <fo:static-content
 flow-name="xsl-region-before
">
     <fo:block text-align="end" font-size="10pt" font-family="serif" line-height="14pt" color="red" > Atelier Webmaster <fo:page-number/> </fo:block>
   </fo:static-content>
 
   <fo:flow
 flow-name="xsl-region-body
" font-size="12pt" line-height="14pt">
      <xsl:apply-templates select="tc-courses/tc-course[position()=1]/course-module[position()=1]"/>
     </fo:flow>
  </fo:page-sequence>
  </fo:root>
 
 </xsl:template>

UP PREVIOUS NEXT -- TIE