XML technologies / DocBook / Generating FO (PDF) / Editing headers and footers / Adding the author

(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)

The previous snippet is extended so that the document’s author appears on the left side of the footer on all even or odd pages:

<xsl:template name="header.content">
    <!-- Leere Kopfzeile -->
</xsl:template>
<xsl:template name="footer.content">
    <xsl:param name="pageclass" select="''"/>
    <xsl:param name="sequence" select="''"/>
    <xsl:param name="position" select="''"/>
    <xsl:param name="gentext-key" select="''"/>
    <xsl:choose>
        <xsl:when test="$sequence ='odd' and $position='center'">
            <fo:page-number/>
        </xsl:when>
        <xsl:when test="$sequence ='even' and $position='center'">
            <fo:page-number/>
        </xsl:when>
        <xsl:when test="$sequence ='even' and $position='left'">
            <xsl:apply-templates select="ancestor-or-self::book/bookinfo/author[1]"/>
        </xsl:when>
        <xsl:when test="$sequence ='odd' and $position='left'">
            <xsl:apply-templates select="ancestor-or-self::book/bookinfo/author[1]"/>
        </xsl:when>
    </xsl:choose>
</xsl:template>

  

back to top