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:
Customizing your document
In your article, add an author element insidearticleinfo(DocBook 4) orinfo(DocBook 5), usingauthor.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
DBBASISURIin 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 elementxsl:stylesheetthe 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">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>Transforming your document
Transform your document using the customization file.
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de
back to top