This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: Re: xsl and toc deepness
- From: Bob Stayton <bobs at caldera dot com>
- To: Gabor Hojtsy <gabor at hojtsy dot hu>, Norman Walsh <ndw at nwalsh dot com>
- Cc: docbook-apps at lists dot oasis-open dot org
- Date: Tue, 16 Jul 2002 16:20:59 -0700
- Subject: Re: DOCBOOK-APPS: Re: xsl and toc deepness
- References: <029f01c21150$74f47970$7f37a3d5@home> <3D060EBC.29D1F8D3@kosek.cz><031801c21158$81770390$7f37a3d5@home> <87hejplz45.fsf@nwalsh.com><018901c22cd3$859ee5a0$b5c14d3e@mia>
On Tue, Jul 16, 2002 at 04:16:54PM +0200, Gabor Hojtsy wrote:
> > / Gabor Hojtsy <gabor@hojtsy.hu> was heard to say:
> > | Both the major TOC, and all section TOCs (like the toc
> > | for <part>s in the PHP manual are infinite deep - seems
> > | like it's treated as a boolean switch
>
> >
> > Can you send a small(ish) sample that demonstrates the problem?
>
> Yes, of course, just I needed some free time, as this is not a company
> project you know ;)
>
> So the XML file:
>
> <?xml version='1.0' encoding='ISO-8859-1' ?>
> <book>
> <title>TOC test</title>
> <part>
> <title>First part</title>
> <chapter>
> <title>First chapter</title>
> <para>Some text</para>
> <sect1>
> <title>Deep section</title>
> <para>Section text</para>
> </sect1>
> </chapter>
> </part>
> </book>
>
> The XSL file:
>
> <?xml version="1.0" encoding="iso-8859-1"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:import href="file:///d:/phpcvs/phpdoc-tools/xsl/html/chunk.xsl"/>
>
> <xsl:param name="toc.section.depth">1</xsl:param>
> </xsl:stylesheet>
>
> Applying this style sheet on the above XML file results in a toc with
>
> I. First part
> 1. First chapter
> Deep section
>
> displayed in the main toc. This is not correct as I have parameterized
> it above to display one TOC level, so it should only be
>
> I. First part
>
> and nothing more...
>
> Hope this clears up what's my problem, and so we can
> find a good way to solve it.
I can at least clarify the meaning of the 'toc.section.depth'
parameter. The 'section' means section or sect*, not
any level in a toc. Setting it to '1' means you want
to include sect1 elements, which is what is happening.
I don't think you can do what you want with just
stylesheet parameters.
You'll probably need to customize some templates in
autotoc.xsl in your customization layer so as to not
apply-templates to child elements.
--
Bob Stayton 400 Encinal Street
Publications Architect Santa Cruz, CA 95060
Technical Publications voice: (831) 427-7796
Caldera International, Inc. fax: (831) 429-1887
email: bobs@caldera.com