[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Header
Hi,
On Sunday 31 December 2006 14:24, Mauritz Jeanson wrote:
> > -----Original Message-----
> > From: Huber Evelyne
> > I'm trying to change the header on the html. I'm aiming for
> > something like part>chapter>section to be displayed in the
> > header to easy navigation and show the current position. and
> > where the words part, chapter, section are links.
> > can anyone help me and show me how the xsl need to look like.
>
> You are looking for "breadcrumbs". See this page:
> http://techwriter.dk/tools/docbook/breadcrumb.html
Very nice! :-)
However, this works for DocBook 4.x documents only. If you make a small
modification it will work with DocBook 5 too. I tried it with the
following modification and it works for me:
<xsl:template name="tw.generate.breadcrumb"
xmlns:d="http://docbook.org/ns/docbook">
<xsl:param name="current.node" select="."/>
<xsl:for-each select="ancestor::*">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:apply-templates select="$current.node"
mode="chunk-filename"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$current.node/title">
<xsl:value-of select="normalize-space($current.node//title)"/>
</xsl:when>
<xsl:when test="$current.node/d:info/d:title">
<xsl:value-of
select="normalize-space($current.node/d:info/d:title)"/>
</xsl:when>
</xsl:choose>
</xsl:element>
<xsl:text> » </xsl:text>
</xsl:for-each>
<!--
We don't want to make the current page an active link
-->
<xsl:if test="$current.node != /*">
<strong>
<xsl:choose>
<xsl:when test="$current.node/title">
<xsl:value-of select="normalize-space($current.node//title)"/>
</xsl:when>
<xsl:when test="$current.node/d:info/d:title">
<xsl:value-of
select="normalize-space($current.node/d:info/d:title)"/>
</xsl:when>
</xsl:choose>
</strong>
</xsl:if>
</xsl:template>
Tom
--
Thomas Schraitle
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]