Use this:
<xsl:when test="$sequence = 'even' and $position = 'right'"> <xsl:value-of select="ancestor-or-self::d:book/d:bookinfo/d:title"></xsl:value-of> </xsl:when>
The title in this case is nested under <bookinfo>
. The d:
label is required. But to do this ensure that you have imported the namespace in the begining of the stylesheet:
<?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:d="http://docbook.org/ns/docbook" exclude-result-prefixes="d" version="1.0">
After this line you can import the docbook.xsl.
Sample beginning of the docbook with book title:
<?xml version="1.0"?> <book xmlns="http://docbook.org/ns/docbook" version="5.0"> <bookinfo> <title>THIS IS THE TITLE OF THE BOOK</title> </bookinfo> ... ... </book>