|
Subject: Re: Auto generating a table of contents From: "Juergen Hermann" <jhe@xxxxxxxxxxx> Date: Tue, 07 Mar 2000 11:17:45 |
On Tue, 07 Mar 2000 08:53:57 +0000, John Morrison wrote:
>where the tag <contents/> is I wish to insert a table of contents, ie
>1. A
>1.1. B
>1.2. C
>2. D
This is what I use for a structure using s1/2/3/4, maybe you can adapt it to
your needs:
<xsl:template match="s2|s3|s4" mode="toc">
<font size="2" face="arial,helvetica,sanserif">
<xsl:number format="1.1.1. " level="multiple" from="s1" count="s2|s3
|s4"/> 
<a href="#{generate-id(.)}">
<xsl:value-of select="@title"/>
</a>
</font>
<br/>
<xsl:if test="count(child::s2|child::s3|child::s4) >= 1">
<dir>
<xsl:apply-templates select="s2|s3|s4" mode="toc"/>
</dir>
</xsl:if>
</xsl:template>
And your call it like so:
<dir>
<xsl:apply-templates select="s2" mode="toc"/>
</dir>
The important thing is to use a "toc" mode, to have it not infere with the
normal content processing.
Ciao, Jürgen
--
Jürgen Hermann (jhe@xxxxxxxxxxx)
WEB.DE AG, Amalienbadstr.41, D-76227 Karlsruhe
Tel.: 0721/94329-0, Fax: 0721/94329-22
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Auto generating a table of contents, John Morrison | Thread | Dynamic Table Generation, nigel . byrnes |
| xalan, TEI DTD, Sebastian Rahtz | Date | Re: xalan, TEI DTD, David Carlisle |
| Month |