Running heads

The headlines of the superordinated chapter and of the current section are inserted into the header.

In this section the application of the marker concept in the header of the pages is shown. The concept consists of two elements. The <fo:marker> element indicates the content displayed in the header, the <fo:retrieve-marker> element indicates the place in the header where this stored content is called up.

Source code

 <fo:page-sequence master-reference="PageMaster.Content">
    <fo:static-content flow-name="xsl-region-before">
       <fo:block text-align="center" font-size="10pt" font-weight="bold">
          <fo:retrieve-marker retrieve-class-name="Headline-Level1"    ❶
           retrieve-position="first-including-carryover"
           retrieve-boundary="page-sequence"/>
       </fo:block>
       <fo:block text-align="left" font-size="10pt">
          <fo:retrieve-marker retrieve-class-name="Headline-Level2"    ❷
           retrieve-position="last-ending-within-page"
           retrieve-boundary="page-sequence"/>
       </fo:block>
    </fo:static-content>
</fo:page-sequence>
...
<xsl:template match="Section/Title">
   <fo:block>
      <fo:marker marker-class-name="Headline-Level1">                  ❸
         <xsl:number level="multiple" count="Section" format="1. "/>   ❸
         <xsl:value-of select="."/>                                    ❸
      </fo:marker>
   </fo:block>
</xsl:template>
<xsl:template match="Section/Section/Title">
   <fo:block>
      <fo:marker marker-class-name="Headline-Level2">                  ❸
         <xsl:number level="multiple" count="Section | Section/Section" format="1.1 "/>
         <xsl:value-of select="."/>                                    ❸
      </fo:marker>
   </fo:block>
</xsl:template>
 

❶ With the <fo:retrieve-marker> element the headline named Headline-Level1 in the retrieve-class-name attribute is copied into the header. This attribute value has to match with the one for the marker-class-name attribute in the <fo:marker> element. The value of the retrieve-position attribute determines which marker appearing on the page shall be copied. With the first-including-carryover value the marker appearing at first is determined, which means possibly the marker of the section which ends on the given page. The retrieve-boundary attribute specifies on which pages this marker shall be used. The page-sequence value determines that the marker shall apply until it is replaced by the marker for the next section.

❷ In this second block the headlines of the second level are processed and outputted under the headline of the first level. In this example the retrieve-position attribute has the value last-ending-within-page. The marker which appears last on the page is copied into the header.

❸ The <fo:marker> element with its obligatory marker-class-name attribute determines that the content of this element is provided for the use with <fo:retrieve-marker> and gives this content a name by which it can be called up in <fo:retrieve-marker>.

<< back next >>

Copyright © dpunkt.verlag GmbH 2004
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "XSL-FO in der Praxis" ("XSL-FO in practice") is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.

dpunkt.verlag GmbH, Ringstraße 19B, 69115 Heidelberg, fon 06221-14830, fax 06221-148399, hallo@dpunkt.de