OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] End pages


On 10/3/06, Elliotte Harold <elharo@metalab.unc.edu> wrote:
> Currently the end of my book includes a colophon. Is there any way to
> tell the DocBook XSL stylesheets to put additional material onto that
> page such as an "About the Author" section (taken from a personblurb) or
>   some additional custom content?

Here's a start (note, this is pretty ugly):

First, make sure you don't duplicate the colophon:
  <xsl:template match="colophon">
    <xsl:variable name="id">
      <xsl:call-template name="object.id"/>
    </xsl:variable>

    <xsl:variable name="master-reference">
      <xsl:call-template name="select.pagemaster"/>
    </xsl:variable>

    <fo:page-sequence hyphenate="{$hyphenate}"
                      master-reference="{$master-reference}">
     <!-- tons of attributes elided.. go and get them?!-->
      <fo:flow flow-name="xsl-region-body">
        <xsl:call-template name="set.flow.properties">
          <xsl:with-param name="element" select="local-name(.)"/>
          <xsl:with-param name="master-reference" select="$master-reference"/>
        </xsl:call-template>

        <fo:block id="{$id}">
          <xsl:call-template name="colophon.titlepage"/>
        </fo:block>
        <!-- Don't repeat the colophon
        <fo:block>
          <xsl:apply-templates/>
        </fo:block>
        -->
      </fo:flow>
    </fo:page-sequence>
  </xsl:template>

Since mine are so short, just grab the content I want and shove it all
on the titlepage
  <xsl:template name="colophon.titlepage.recto">
    <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format";
              xsl:use-attribute-sets="orm-colophon.title.properties">
      <xsl:text>About the Author</xsl:text>
      <xsl:if test="count(/book/bookinfo/author) &gt; 1">
        <xsl:text>s</xsl:text>
      </xsl:if>
    </fo:block>
    <xsl:apply-templates select="/book/bookinfo/author/authorblurb"
mode="orm-colophon"/>
    <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format";
              xsl:use-attribute-sets="orm-colophon.title.properties">
      <xsl:text>Colophon</xsl:text>
    </fo:block>
    <xsl:apply-templates/>
  </xsl:template>

  <!-- don't repeat colophon -->
  <xsl:template name="colophon.titlepage">
    <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format";>
      <xsl:variable name="recto.content">
        <xsl:call-template name="colophon.titlepage.before.recto"/>
        <xsl:call-template name="colophon.titlepage.recto"/>
      </xsl:variable>
      <xsl:variable name="recto.elements.count">
        <xsl:choose>
          <xsl:when
test="function-available('exsl:node-set')"><xsl:value-of
select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
          <xsl:otherwise>1</xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:if test="(normalize-space($recto.content) != '') or
($recto.elements.count &gt; 0)">
        <!-- Do it here... -->
        <fo:block><xsl:copy-of select="$recto.content"/></fo:block>
      </xsl:if>

      <!-- don't care about verso, mine are always on a recto... -->
      <xsl:variable name="verso.content">
        <xsl:call-template name="colophon.titlepage.before.verso"/>
        <xsl:call-template name="colophon.titlepage.verso"/>
      </xsl:variable>
      <xsl:variable name="verso.elements.count">
        <xsl:choose>
          <xsl:when
test="function-available('exsl:node-set')"><xsl:value-of
select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
          <xsl:otherwise>1</xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:if test="(normalize-space($verso.content) != '') or
($verso.elements.count &gt; 0)">
        <fo:block><xsl:copy-of select="$verso.content"/></fo:block>
      </xsl:if>
      <xsl:call-template name="colophon.titlepage.separator"/>
    </fo:block>
  </xsl:template>

  <!-- grab the content here -->
  <xsl:template match="authorblurb" mode="orm-colophon">
    <xsl:apply-templates/>
  </xsl:template>

  <!-- only want it in the colophon -->
  <xsl:template match="authorblurb"/>



HTH,
Keith


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]