Ahh ... I fixed the problem. I found that both 'dedication' chunks had an 
xml:id of "glossary" which is why the page number for the glossary was being 
generated in the TOC. Having changed the id names, the customisation works 
fine. 
Thanks Bob.

Dave Gardiner




-----Original Message-----

From: "redlettucemail" <[email protected]>

To: [email protected]

Date: Mon, 19 Sep 2011 18:23:16 +1000

Subject: Re: [docbook-apps] Make dedication element appear in TOC










Thanks so far 
Bob - I got the dedication element to
appear in the TOC (“Executive summary” and “Acknowledgments”) but 
now I’m
getting the page number of the Glossary (page 103). What code controls the 
page
numbering then (is it toc.title.p)? Here is my customisation:




<xsl:templatename="division.toc"><xsl:param
name
="toc-context"
select
="."/><xsl:param
name
="toc.title.p"
select
="true()"/><xsl:variablename="cid"><xsl:call-templatename="object.id">
<xsl:with-paramname="object"select="$toc-context"/></xsl:call-template></xsl:variable><xsl:variablename="nodes"select="$toc-context/d:part|$toc-context/d:reference|$toc-context/d:dedication|$toc-context/d:preface|$toc-context/d:chapter|$toc-context/d:appendix|$toc-context/d:article|$toc-context/d:bibliography|$toc-context/d:glossary|$toc-context/d:index"/><xsl:if
test
="$nodes"><fo:block
id
="toc...{$cid}"

xsl:use-attribute-sets="toc.margin.properties">
<xsl:iftest="$axf.extensions != 
0"><xsl:attributename="axf:outline-level">1</xsl:attribute><xsl:attributename="axf:outline-expand">false</xsl:attribute><xsl:attributename="axf:outline-title"><xsl:call-templatename="gentext"><xsl:with-paramname="key"select="'TableofContents'"/></xsl:call-template></xsl:attribute>
</xsl:if>
<xsl:iftest="$toc.title.p"><xsl:call-templatename="table.of.contents.titlepage"/>
</xsl:if>
<xsl:apply-templatesselect="$nodes"mode="toc"><xsl:with-paramname="toc-context"select="$toc-context"/>
</xsl:apply-templates></fo:block></xsl:if></xsl:template><xsl:templatematch="d:dedication"mode="toc"><xsl:param
name
="toc-context"
select
="."/><xsl:call-templatename="toc.line"><xsl:with-paramname="toc-context"select="$toc-context"/></xsl:call-template></xsl:template>



Dave Gardiner



-----Original Message-----

From: "Bob Stayton" <[email protected]>

To: "redlettucemail" <[email protected]>, 
<[email protected]>

Date: Sun, 18 Sep 2011 20:51:43 -0700

Subject: Re: [docbook-apps] Make dedication element appear in TOC





Hi Dave,

I think you also need to add a template 
with 
match="d:dedication" mode="toc", as for other elements (see examples in 
autotoc.xsl).  There is no match="*" for mode="toc" to catch new 
elements.



Bob Stayton
Sagehill Enterprises
[email protected] [mailto:[email protected]]





----- Original Message -----
  
From: 
  redlettucemail [mailto:[email protected]]

  
To: [email protected] 
[mailto:[email protected]]
  
Sent: Sunday, September 18, 2011 
7:56 
  PM
  
Subject: [docbook-apps] Make 
dedication 
  element appear in TOC
  

  
How 
  do I customise the stylesheets so that the “dedication” element 
appears in the 
  generated TOC? It appears that this and “acknowledgments” are the only 


  elements that are not extracted to a TOC.
  

  
I thought I had 
found the right code with 
  <xsl:template name="division.toc"> in autotoc.xsl. I added 
  $toc-context/d:dedication to variable “nodes” – but all that did was 

copy the 
  entire contents of my “dedication” chunk to the TOC. It didn’t 
create the 
  title with a leader line and page number.
  
Thanks,Dave Gardiner

Reply via email to