This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] XSL: No toc for qandaset


> 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>

Regards
Grant



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]