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] Adding a Book level TOC to an appendix


Hi Scott,
Actually, you were pretty close.  Just a couple of changes are needed.
 
First, your generate.toc parameter needs to keep the "toc" on book but add the others to appendix:
 
<xsl:param name="generate.toc">
book  toc,title
appendix  figure,table
</xsl:param>
 
That's because the find.path.params finds the values for the current element, which is appendix. If you use this parameter, then $toc.params will have the value "figure,table" in your match="appendix" template.
 
Then your code in the match="appendix" template just has to adjust the XPath selections to get above the current context.  You had this:
 
    <xsl:if test="contains($toc.params, 'figure') and .//figure">
         <xsl:call-template name="list.of.titles">
          <xsl:with-param name="titles" select="'figure'"/>
          <xsl:with-param name="nodes" select=".//figure"/>
         </xsl:call-template>
    </xsl:if>
The XPath .//figure in the first and fourth lines finds all figures relative to the context node, which in this case is the appendix.  What you want is //figure (no leading dot), which will find all figures starting at the root node of the document.  Be sure to change both lines.  Then it should work.
 
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net
 
 
----- Original Message -----
Sent: Monday, November 13, 2006 10:52 AM
Subject: [docbook-apps] Adding a Book level TOC to an appendix

I've been really looking around and I cant seem to figure out how to publish a higher level of table of contents into a lower toc-context.

The goal is to move the Book level Table of Figures, or Book level Table of Tables or Book Level Table of Examples into an Appendix.

Modifing the basic params will NOT do this..
example.. It generates a toc of existing items in the Appendix itself..

<xsl:param name="generate.toc" select="'appendix toc'">

Somewhere I need to modify a xsl template

I was looking at the html\component.xsl

<xsl:template match="appendix">
   <!-- Test Mod here -->

    <xsl:if test="contains($toc.params, 'figure') and .//figure">
         <xsl:call-template name="list.of.titles">
          <xsl:with-param name="titles" select="'figure'"/>
          <xsl:with-param name="nodes" select=".//figure"/>
         </xsl:call-template>
    </xsl:if>


I think the toc-context variable may be adjust the tree level but I am still new at xsl processing.

Can you call something like parent::book ?

<xsl:param name="toc-context" select="."/>

Please Help..


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