XML technologies / DocBook / The DocBook XSL stylesheets / Customizing a title page directly / Customizing the output of author

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

This section shows how to display an author element on an article’s title page, including the localized word Autor. Since this customization applies only to an article’s title page, use a template in mode article.titlepage.recto.mode. Proceed as follows:

  1. Customizing your document
    In your article, add an author element inside articleinfo (DocBook 4) or info (DocBook 5), using author.

  2. Creating a customization file
    a. Create a customization file appropriate for the DocBook version you are processing:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
  <xsl:import href="DBBASISURI/html/docbook.xsl"/> 
  <!-- Ihre Anpassungen --> 
</xsl:stylesheet>

b. Replace the placeholder DBBASISURI in the preceding stylesheet with the official URI of the DocBook stylesheets:

  • For DocBook 4: "http://docbook.sourceforge.net/release/xsl/current"

  • For DocBook 5: "http://docbook.sourceforge.net/release/xsl-ns/current". Also add to the root element xsl:stylesheet the namespace URI "http://docbook.org/ns/docbook", so that the root element looks like this:

<xsl:stylesheet version="1.0" xmlns:d="http://docbook.org/ns/docbook" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  1. Adding templates to your customization file
    Add the following template to your customization file:

  • For DocBook 4:

<xsl:template match="author" mode="article.titlepage.recto.mode"> 
    <xsl:call-template name="gentext"> 
        <xsl:with-param name="key" select="'Author'"/> 
    </xsl:call-template> 
    <xsl:text>: </xsl:text> 
    <xsl:call-template name="person.name.last-first"/> 
</xsl:template>

  • For DocBook 5:

<xsl:template match="d:author" mode="article.titlepage.recto.mode"> 
    <xsl:call-template name="gentext"> 
        <xsl:with-param name="key" select="'Author'"/> 
    </xsl:call-template> 
    <xsl:text>: </xsl:text> 
    <xsl:call-template name="person.name.last-first"/> 
</xsl:template>

  1. Transforming your document
    Transform your document using the customization file.

  

back to top