----- Original Message -----
Sent: Thursday, August 23, 2007 7:18
AM
Subject: [docbook-apps] Customize header
content, problem with 1.73.1
I have a customization layer
which sets header content to
book title centered on even, chapter title on odd pages. This works fine
with the Docbook 4.5 DTD and the 1.73.1 snapshot stylesheet, but with db 5.0
the book title on even pages is missing. This must be a namespace problem, but I
can't see it.
Any help appreciated. My
customization is below.
Ron
4.5 DTD version
<?xml version="1.0"
encoding="UTF-8" ?>
<!DOCTYPE
book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<book id="SSF"
lang="EN" >
<title>A Title for the 4.5 version</title>
<chapter>
<para>.....</para><para>....</para></chapter>
<chapter>
<para>.....</para><para>....</para></chapter>
</book>
5.0 version
<?xml version="1.0"
encoding="UTF-8" ?>
<!DOCTYPE
book>
<book xml:id="SSF"
xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="EN">
<info>
<title>A Title for the 5.0 version</title>
</info>
<chapter>
<para>.....</para><para>....</para></chapter>
<chapter>
<para>.....</para><para>....</para></chapter>
</book>
CUSTOMIZATION LAYER FOR
5.0
<?xml version="1.0"
encoding="UTF-8"?>
<xsl:stylesheet
xmlns:d="http://docbook.org/ns/docbook"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:exsl="http://exslt.org/common"
exclude-result-prefixes="exsl"
version="1.0">
<!--
import 1.71.1 stylesheet -->
<!--
<xsl:import
href="/Applications/Utilities/oxygen/8.2/oxygen/frameworks/docbook/xsl/fo/docbook.xsl"
/> -->
<!-- import the 1.73.1 snapshot
name space aware stylesheet -->
<xsl:import
href="/Applications/Utilities/oxygen/8.2/oxygen/frameworks/docbook/5.0/docbook-xsl-ns-1.73.1/fo/docbook.xsl" />
<!-- import the 1.73.1 snapshot stylesheet
-->
<!-- <xsl:import
href="/Applications/Utilities/oxygen/8.2/oxygen/frameworks/docbook/5.0/docbook-xsl-1.73.1/fo/docbook.xsl"
/> -->
<!--
==============================================================================================
-->
<!-- select single- ("0") or
double-sided ("1") output -->
<xsl:param
name="double.sided" select="1" />
<!-- Customize the header content, book title centered on even,
chapter title on odd pages -->
<!--
==============================================================================================
-->
<!-- set relative space in header for
left, center and right cells -->
<xsl:param
name="header.column.widths" select="'1
10 1'" >
</xsl:param>
<!--
==============================================================================================
-->
<!-- rule below header
-->
<xsl:param name="header.rule"
select="1" >
</xsl:param>
<!--
define the rule below the header -->
<xsl:template
name="head.sep.rule">
<xsl:if
test="$header.rule != 0">
<xsl:attribute name="border-bottom-width">0.5pt</xsl:attribute>
<xsl:attribute name="border-bottom-style">solid</xsl:attribute>
<xsl:attribute
name="border-bottom-color">black</xsl:attribute>
</xsl:if>
</xsl:template>
<!--
==============================================================================================
-->
<!-- set header content style
-->
<xsl:attribute-set name="header.content.properties">
<xsl:attribute
name="font-family">Cardo</xsl:attribute>
<xsl:attribute
name="font-size">11pt</xsl:attribute>
<xsl:attribute
name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<!--
==============================================================================================
-->
<!-- Customize the header content,
book title centered on even, chapter title on odd pages
-->
<xsl:template name="header.content">
<xsl:param
name="pageclass" select="''"/>
<xsl:param
name="sequence" select="''"/>
<xsl:param
name="position" select="''"/>
<xsl:param
name="gentext-key" select="''"/>
<xsl:variable
name="candidate">
<!-- sequence can be odd, even, first, blank -->
<!-- position can be left, center,
right -->
<xsl:choose>
<xsl:when test="$sequence = 'odd' and $position =
'left'">
<fo:retrieve-marker retrieve-class-name="section.head.marker"
retrieve-position="first-including-carryover"
retrieve-boundary="page-sequence"/>
</xsl:when>
<xsl:when test="$sequence = 'odd'
and $position = 'center'">
<xsl:apply-templates select="." mode="titleabbrev.markup"/>
<xsl:call-template name="draft.text"/>
</xsl:when>
<xsl:when test="$sequence = 'odd'
and $position = 'right'">
<xsl:call-template name="draft.text"/>
</xsl:when>
<xsl:when test="$sequence = 'even'
and $position = 'left'">
<xsl:call-template name="draft.text"/>
</xsl:when>
<xsl:when test="$sequence = 'even'
and $position = 'center'">
<xsl:value-of select="ancestor-or-self::d:book/d:info/d:title"/>
<!-- 4.5
version <xsl:value-of
select="ancestor-or-self::book/title"/>
********** -->
</xsl:when>
<xsl:when test="$sequence = 'even'
and $position = 'right'">
</xsl:when>
<xsl:when test="$sequence =
'first' and $position = 'left'">
</xsl:when>
<xsl:when test="$sequence =
'first' and $position = 'right'">
</xsl:when>
<xsl:when test="$sequence =
'first' and $position = 'center'">
<xsl:value-of
select="ancestor-or-self::d:book/d:info/d:orgname"/>
<!-- 4.5
version
select="ancestor-or-self::book/info/corpauthor"/>
********** -->
</xsl:when>
<xsl:when
test="$sequence = 'blank' and $position =
'left'">
</xsl:when>
<xsl:when
test="$sequence = 'blank' and $position =
'center'">
<xsl:text>This page intentionally left
blank</xsl:text>
</xsl:when>
<xsl:when
test="$sequence = 'blank' and $position =
'right'">
</xsl:when>
</xsl:choose>
</xsl:variable>
<!-- Does runtime parameter
turn off blank page headers? -->
<xsl:choose>
<xsl:when test="$sequence='blank' and
$headers.on.blank.pages=0">
<!-- no output -->
</xsl:when>
<!-- titlepages have no headers -->
<xsl:when test="$pageclass = 'titlepage'">
<!-- no output -->
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$candidate"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet
>
--
Ron Catterall, Phd, DSc
email:
ron@catterall.net
Prolongacion de Hidalgo
140
http://catterall.net/
San Felipe del
Agua
tel: +52 951
520 1821
Oaxaca 68020
Mexico
fax: +1 530
348
8309
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org For
additional commands, e-mail: docbook-apps-help@lists.oasis-open.org