Here you go.  The first template fills in a placeholder template in the 
stylesheet that is called at the start of the part titlepage before any other 
content.  It adds a marker for the part title.

<xsl:template name="part.titlepage.before.recto">
  <fo:marker marker-class-name="part.head.marker">
         <xsl:apply-templates select="d:title|d:info/d:title" 
mode="titlepage.mode"/>
  </fo:marker>
</xsl:template>

The second template is a customization of the 'header.content' template that is 
used to specify the content of the running headers.  It is documented in:

http://www.sagehill.net/docbookxsl/PrintHeaders.html#PrintHeadersText

In this customization, I just changed the reference in @retrieve-class-name 
from "section.head.marker" to "part.head.marker" to refer to the new marker, 
and changed the @retrieve-boundary property to "document".

<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="''"/>

<!--
  <fo:block>
    <xsl:value-of select="$pageclass"/>
    <xsl:text>, </xsl:text>
    <xsl:value-of select="$sequence"/>
    <xsl:text>, </xsl:text>
    <xsl:value-of select="$position"/>
    <xsl:text>, </xsl:text>
    <xsl:value-of select="$gentext-key"/>
  </fo:block>
-->

  <fo:block>

    <!-- sequence can be odd, even, first, blank -->
    <!-- position can be left, center, right -->
    <xsl:choose>
      <xsl:when test="$sequence = 'blank'">
        <!-- nothing -->
      </xsl:when>

      <xsl:when test="$position='left'">
        <!-- Same for odd, even, empty, and blank sequences -->
        <xsl:call-template name="draft.text"/>
      </xsl:when>

      <xsl:when test="($sequence='odd' or $sequence='even') and 
$position='center'">
        <xsl:if test="$pageclass != 'titlepage'">
          <xsl:choose>
            <xsl:when test="ancestor::book and ($double.sided != 0)">
              <fo:retrieve-marker retrieve-class-name="part.head.marker"
                                  retrieve-position="first-including-carryover"
                                  retrieve-boundary="document"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:apply-templates select="." mode="titleabbrev.markup"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:if>
      </xsl:when>

      <xsl:when test="$position='center'">
        <!-- nothing for empty and blank sequences -->
      </xsl:when>

      <xsl:when test="$position='right'">
        <!-- Same for odd, even, empty, and blank sequences -->
        <xsl:call-template name="draft.text"/>
      </xsl:when>

      <xsl:when test="$sequence = 'first'">
        <!-- nothing for first pages -->
      </xsl:when>

      <xsl:when test="$sequence = 'blank'">
        <!-- nothing for blank pages -->
      </xsl:when>
    </xsl:choose>
  </fo:block>
</xsl:template>

</xsl:stylesheet>

Bob Stayton
Sagehill Enterprises
[email protected]


  ----- Original Message ----- 
  From: Paddy O' Connell 
  To: [email protected] 
  Sent: Thursday, January 05, 2012 4:11 AM
  Subject: [docbook-apps] Titles in 


  Hi,
  I'm currently completing a 2 large technical documents using Oxygen, Docbook 
5, Apache FOP and Saxon 6.5.5 and have managed to complete all the 
customisations needed, apart from one which is proving to be beyond me at the 
moment, it's my first venture into XML.
  I want to include the <part> title in the header of the body pages as it is 
shown in the toc pages, there are two books one titled "Technical Handbook - 
Non-Domestic" and the other "Technical Handbook - Domestic" and I need to show 
this on the body pages along with the <chapter> title which is already showing.
  I have managed to find the file I need to work on, I think, "pagesetup.xsl" 
where I created a test <xsl:text> tag which shows the text I enter within it 
but on all pages. I think I need to use retrieve marker from my current 
investigations as I need the <part> title for each book to appear on the body 
pages rather than creating individual customisations using the <xsl:text> tag 
approach.
  Can anyone help a poor beginner who is really a designer and not a code 
master, I have worked hard and managed to get all the other custom work done 
and learned a lot about XML along the way but this bit is beating me:)
  Cheers:)

  ---------------------------
  Best Regards
  Paddy O' Connell
  Fife Design Partnership
  01334 828393
  www.fifedesign.co.uk
  [email protected]






Reply via email to