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] Processing titles for the PDF TOC

Hi Jeff,
I presume you want the remark to show in the title in the body of the document, just not in the TOC.

Your template doesn't work because the stylesheet does not stay in mode="titleabbrev.markup" to process the title. It uses that mode to select titleabbrev if it exists and then falls back to title if it does not. But whichever it selects, it processes it in mode="title.markup". See this template in common/titles.xsl:

<xsl:template match="*" mode="titleabbrev.markup">
 <xsl:param name="allow-anchors" select="0"/>
 <xsl:param name="verbose" select="1"/>

   <xsl:when test="titleabbrev">
     <xsl:apply-templates select="titleabbrev[1]" mode="title.markup">
       <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
     <xsl:apply-templates select="." mode="title.markup">
       <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
       <xsl:with-param name="verbose" select="$verbose"/>

And then in title.markup mode, it also does not stay in that mode:

<xsl:template match="titleabbrev" mode="title.markup">
 <xsl:param name="allow-anchors" select="0"/>

   <xsl:when test="$allow-anchors != 0">
     <xsl:apply-templates mode="no.anchor.mode"/>

But this template gives you a clue, even if it isn't clear at first. The $allow-anchors template parameter is used to control whether a rendered title contains active links if the title contains linking elements. In a TOC the title itself is a link and you cannot nest links, so a TOC line is processed with allow-anchors=0. If so, the above template switches to mode="no.anchor.mode" to process the title. That mode *is* sticky, so all the children are also processed in that mode. So this customization should work:

<xsl:template match="remark" mode="no.anchor.mode"/>

Bob Stayton
Sagehill Enterprises

----- Original Message ----- From: "Jeff Hooker" <Jeff_Hooker@pmc-sierra.com>
To: "DocBook Apps" <docbook-apps@lists.oasis-open.org>
Sent: Thursday, August 02, 2012 11:07 AM
Subject: [docbook-apps] Processing titles for the PDF TOC

Hi all,

I'm using docbook-xsl-1.73.2 and Saxon 9 HE to generate PDFs via XEP.

I'm attempting to strip any "remark" elements that authors have embedded
in "title" elements from the content reproduced in the TOC. As far as I
can tell, simply adding

   <xsl:template match="remark" mode="titleabbrev.markup"/>

should have done the trick, but it hasn't. In fact, none of

   <xsl:template match="remark" mode="label.markup"/>
   <xsl:template match="remark" mode="toc"/>

has made any kind of impression, which is puzzling.

From what I can see, the processing for the titles found in the TOC is
done via the toc.line template, which generates the title content via
<xsl:apply-templates select="." mode="titleabbrev.markup"/>, so
<xsl:template match="remark" mode="titleabbrev.markup"/> should prevent
remarks from being processed. I can see nothing in the scripts to
override it, yet the continuing presence of the remark elements in my
output says otherwise.


To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org

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