[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
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:
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:with-param name="titles" select="'figure'"/>
<xsl:with-param name="nodes" select=".//figure"/>
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.