1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets. Do not edit this file.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
6 <!-- ********************************************************************
8 ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
12 and other information.
14 ******************************************************************** -->
16 <!-- ==================================================================== -->
18 <xsl:template match="toc">
21 <xsl:if test="$process.source.toc != 0">
22 <!-- if the toc isn't empty, process it -->
23 <xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
24 <xsl:apply-templates/>
29 <xsl:if test="$process.empty.source.toc != 0">
31 <xsl:when test="parent::section or parent::sect1 or parent::sect2 or parent::sect3 or parent::sect4 or parent::sect5">
32 <xsl:apply-templates select="parent::*" mode="toc.for.section"/>
34 <xsl:when test="parent::article">
35 <xsl:apply-templates select="parent::*" mode="toc.for.component"/>
37 <xsl:when test="parent::book or parent::part">
38 <xsl:apply-templates select="parent::*" mode="toc.for.division"/>
40 <xsl:when test="parent::set">
41 <xsl:apply-templates select="parent::*" mode="toc.for.set"/>
43 <!-- there aren't any other contexts that allow toc -->
46 <xsl:text>I don't know how to make a TOC in this context!</xsl:text>
55 <xsl:template match="tocpart|tocchap |toclevel1|toclevel2|toclevel3|toclevel4|toclevel5">
56 <xsl:variable name="sub-toc">
57 <xsl:if test="tocchap|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5">
59 <xsl:when test="$toc.list.type = 'dl'">
61 <xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
62 <xsl:apply-templates select="tocchap|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5"/>
67 <xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
68 <xsl:apply-templates select="tocchap|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5"/>
75 <xsl:apply-templates select="tocentry[position() != last()]"/>
78 <xsl:when test="$toc.list.type = 'dl'">
80 <xsl:apply-templates select="tocentry[position() = last()]"/>
82 <xsl:copy-of select="$sub-toc"/>
86 <xsl:apply-templates select="tocentry[position() = last()]"/>
87 <xsl:copy-of select="$sub-toc"/>
93 <xsl:template match="tocentry|tocfront|tocback">
95 <xsl:when test="$toc.list.type = 'dl'">
97 <xsl:call-template name="tocentry-content"/>
102 <xsl:call-template name="tocentry-content"/>
108 <xsl:template match="tocentry[position() = last()]" priority="2">
109 <xsl:call-template name="tocentry-content"/>
112 <xsl:template name="tocentry-content">
113 <xsl:variable name="targets" select="key('id',@linkend)"/>
114 <xsl:variable name="target" select="$targets[1]"/>
117 <xsl:when test="@linkend">
118 <xsl:call-template name="check.id.unique">
119 <xsl:with-param name="linkend" select="@linkend"/>
122 <xsl:attribute name="href">
123 <xsl:call-template name="href.target">
124 <xsl:with-param name="object" select="$target"/>
127 <xsl:apply-templates/>
131 <xsl:apply-templates/>
136 <!-- ==================================================================== -->
138 <xsl:template match="*" mode="toc.for.section">
139 <xsl:call-template name="section.toc"/>
142 <xsl:template match="*" mode="toc.for.component">
143 <xsl:call-template name="component.toc"/>
146 <xsl:template match="*" mode="toc.for.section">
147 <xsl:call-template name="section.toc"/>
150 <xsl:template match="*" mode="toc.for.division">
151 <xsl:call-template name="division.toc"/>
154 <xsl:template match="*" mode="toc.for.set">
155 <xsl:call-template name="set.toc"/>
158 <!-- ==================================================================== -->
160 <xsl:template match="lot|lotentry">