[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] XSL: No toc for qandaset
On Mon, Aug 04, 2003 at 11:44:34AM +1200, Grant McLean wrote: > > On Sun, Aug 03, 2003 at 09:58:14PM +1200, Grant McLean wrote: > >> I'm having trouble getting the DocBook XSL stylesheets to generate a > >> table of contents for my FAQ document. It all used to work, but I > >> have rebuilt my machine since then and upgraded to the latest > >> stylesheets. > >> > >> My driver file includes the following parameter definitions: > >> > >> <xsl:param name="generate.toc"> > >> qandaset toc > >> qandadiv nop > >> </xsl:param> > >> <xsl:param name="generate.section.toc.level" select="3"></xsl:param> > >> > >> Which did previously give me the desired multi-level TOC at the > >> start of the document and no TOC in each section. But now when > >> I generate the HTML, I get nothing where the table of contents > >> ought to be. It used to work with version 1.51 of the stylesheets. > >> > >> I have poked around in qandaset.xsl and found this section: > >> > >> <xsl:if test="contains($toc.params, 'toc') and $toc = '1'"> > >> <xsl:call-template name="process.qanda.toc"/> > >> </xsl:if> > >> > >> If I remove the xsl:if and make it this: > >> > >> <p>$toc.params: '<xsl:value-of select="$toc.params"/>'</p> > >> <p>$toc: '<xsl:value-of select="$toc"/>'</p> > >> <xsl:call-template name="process.qanda.toc"/> > >> > >> then I do get an appropriately formatted TOC preceded by this: > >> > >> <p>$toc.params: 'toc'</p> > >> <p>$toc: ''</p> > >> > >> I tried to trace back to determine why $toc was empty but quickly got > >> out of my depth. Is it possible this is a bug in the stylesheets or > >> am I doing something wrong? > >> > >> The full document and driver file are in CVS here: > >> > >> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perl-xml/perl-xml-faq/ > > > > > > Now the stylesheets look for a dbhtml processing instruction > > as well to turn on each qandaset toc. That is what the > > $toc variable is about. > > > > See http://www.sagehill.net/docbookxsl/QandAtoc.html > > Ok, I follow that now, but doesn't that mean the test should be an 'or'. > IE: If toc is enabled for this type of section, OR this specific section. > > At the moment, it seems to require both the toc.params setting and > the PI in the XML source. > > So perhaps the test should be: > > <xsl:if test="contains($toc.params, 'toc') or $toc = '1'"> > <xsl:call-template name="process.qanda.toc"/> > </xsl:if> Generally in the stylesheets, local values can be used to override the global value. So I would suggest this logic instead: <xsl:if test="(contains($toc.params, 'toc') and $toc != '0') or $toc = '1'"> That way, if $toc.params turns it on globally you can turn it off for one instance by setting a PI to zero. Absense of the PI or any other value will leave it to the global value. -- Bob Stayton 400 Encinal Street Publications Architect Santa Cruz, CA 95060 Technical Publications voice: (831) 427-7796 The SCO Group fax: (831) 429-1887 email: bobs@sco.com
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]