docbook_xsl_wrapper 0.1.2 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/CHANGELOG +41 -0
- data/README.md +9 -17
- data/bin/docbook_xsl_wrapper +9 -14
- data/docbook_xsl_wrapper.gemspec +8 -7
- data/lib/docbook_xsl_wrapper.rb +24 -1
- data/lib/docbook_xsl_wrapper/epub.rb +124 -122
- data/lib/docbook_xsl_wrapper/options.rb +1 -1
- data/lib/docbook_xsl_wrapper/validate.rb +22 -0
- data/lib/docbook_xsl_wrapper/version.rb +1 -1
- data/schema/docbookxi.rng +18654 -0
- data/spec/docbook_xsl_wrapper/validate_spec.rb +64 -0
- data/xsl/AUTHORS +4 -0
- data/xsl/COPYING +48 -0
- data/xsl/REVISION +1 -0
- data/xsl/VERSION.xsl +115 -0
- data/xsl/common/addns.xsl +124 -0
- data/xsl/common/af.xml +1272 -0
- data/xsl/common/am.xml +1272 -0
- data/xsl/common/ar.xml +1272 -0
- data/xsl/common/as.xml +703 -0
- data/xsl/common/ast.xml +703 -0
- data/xsl/common/autoidx-kimber.xsl +45 -0
- data/xsl/common/autoidx-kosek.xsl +155 -0
- data/xsl/common/az.xml +715 -0
- data/xsl/common/bg.xml +767 -0
- data/xsl/common/bn.xml +1272 -0
- data/xsl/common/bn_in.xml +703 -0
- data/xsl/common/bs.xml +705 -0
- data/xsl/common/ca.xml +703 -0
- data/xsl/common/charmap.xsl +222 -0
- data/xsl/common/common.xsl +2129 -0
- data/xsl/common/cs.xml +743 -0
- data/xsl/common/cy.xml +1288 -0
- data/xsl/common/da.xml +707 -0
- data/xsl/common/de.xml +709 -0
- data/xsl/common/el.xml +772 -0
- data/xsl/common/en.xml +1272 -0
- data/xsl/common/entities.ent +67 -0
- data/xsl/common/eo.xml +1272 -0
- data/xsl/common/es.xml +719 -0
- data/xsl/common/et.xml +1272 -0
- data/xsl/common/eu.xml +1272 -0
- data/xsl/common/fa.xml +703 -0
- data/xsl/common/fi.xml +713 -0
- data/xsl/common/fr.xml +733 -0
- data/xsl/common/ga.xml +1272 -0
- data/xsl/common/gentext.xsl +855 -0
- data/xsl/common/gl.xml +1272 -0
- data/xsl/common/gu.xml +703 -0
- data/xsl/common/he.xml +1272 -0
- data/xsl/common/hi.xml +703 -0
- data/xsl/common/hr.xml +705 -0
- data/xsl/common/hu.xml +721 -0
- data/xsl/common/id.xml +1272 -0
- data/xsl/common/insertfile.xsl +113 -0
- data/xsl/common/is.xml +715 -0
- data/xsl/common/it.xml +1272 -0
- data/xsl/common/ja.xml +703 -0
- data/xsl/common/ka.xml +743 -0
- data/xsl/common/kn.xml +1272 -0
- data/xsl/common/ko.xml +1272 -0
- data/xsl/common/ky.xml +775 -0
- data/xsl/common/l10n.dtd +64 -0
- data/xsl/common/l10n.xml +78 -0
- data/xsl/common/l10n.xsl +598 -0
- data/xsl/common/la.xml +1272 -0
- data/xsl/common/labels.xsl +933 -0
- data/xsl/common/lt.xml +721 -0
- data/xsl/common/lv.xml +1272 -0
- data/xsl/common/ml.xml +703 -0
- data/xsl/common/mn.xml +773 -0
- data/xsl/common/mr.xml +703 -0
- data/xsl/common/nb.xml +1272 -0
- data/xsl/common/nds.xml +709 -0
- data/xsl/common/nl.xml +703 -0
- data/xsl/common/nn.xml +1272 -0
- data/xsl/common/olink.xsl +1284 -0
- data/xsl/common/or.xml +1272 -0
- data/xsl/common/pa.xml +703 -0
- data/xsl/common/pi.xml +168 -0
- data/xsl/common/pi.xsl +347 -0
- data/xsl/common/pl.xml +721 -0
- data/xsl/common/pt.xml +1272 -0
- data/xsl/common/pt_br.xml +1272 -0
- data/xsl/common/refentry.xsl +1353 -0
- data/xsl/common/ro.xml +1272 -0
- data/xsl/common/ru.xml +769 -0
- data/xsl/common/sk.xml +1272 -0
- data/xsl/common/sl.xml +1272 -0
- data/xsl/common/sq.xml +1272 -0
- data/xsl/common/sr.xml +763 -0
- data/xsl/common/sr_Latn.xml +722 -0
- data/xsl/common/subtitles.xsl +181 -0
- data/xsl/common/sv.xml +707 -0
- data/xsl/common/ta.xml +703 -0
- data/xsl/common/table.xsl +515 -0
- data/xsl/common/targetdatabase.dtd +49 -0
- data/xsl/common/targets.xsl +338 -0
- data/xsl/common/te.xml +703 -0
- data/xsl/common/th.xml +1272 -0
- data/xsl/common/titles.xsl +850 -0
- data/xsl/common/tl.xml +1272 -0
- data/xsl/common/tr.xml +709 -0
- data/xsl/common/uk.xml +769 -0
- data/xsl/common/ur.xml +705 -0
- data/xsl/common/utility.xsl +291 -0
- data/xsl/common/vi.xml +1272 -0
- data/xsl/common/xh.xml +1272 -0
- data/xsl/common/zh.xml +703 -0
- data/xsl/common/zh_cn.xml +703 -0
- data/xsl/common/zh_tw.xml +703 -0
- data/xsl/epub/docbook.xsl +1769 -0
- data/xsl/epub3/chunk.xsl +30 -0
- data/xsl/epub3/docbook-epub.css.xml +142 -0
- data/xsl/epub3/docbook.xsl +20 -0
- data/xsl/epub3/epub3-chunk-mods.xsl +52 -0
- data/xsl/epub3/epub3-element-mods.xsl +2533 -0
- data/xsl/epub3/titlepage.templates.xml +712 -0
- data/xsl/epub3/titlepage.templates.xsl +3842 -0
- data/xsl/lib/lib.xsl +533 -0
- data/xsl/xhtml/admon.xsl +142 -0
- data/xsl/xhtml/annotations.xsl +160 -0
- data/xsl/xhtml/autoidx.xsl +831 -0
- data/xsl/xhtml/autotoc.xsl +706 -0
- data/xsl/xhtml/biblio-iso690.xsl +1302 -0
- data/xsl/xhtml/biblio.xsl +1371 -0
- data/xsl/xhtml/block.xsl +584 -0
- data/xsl/xhtml/callout.xsl +210 -0
- data/xsl/xhtml/chunk-code.xsl +675 -0
- data/xsl/xhtml/chunk-common.xsl +1627 -0
- data/xsl/xhtml/chunker.xsl +317 -0
- data/xsl/xhtml/component.xsl +440 -0
- data/xsl/xhtml/division.xsl +214 -0
- data/xsl/xhtml/ebnf.xsl +331 -0
- data/xsl/xhtml/footnote.xsl +346 -0
- data/xsl/xhtml/formal.xsl +496 -0
- data/xsl/xhtml/glossary.xsl +602 -0
- data/xsl/xhtml/graphics.xsl +1537 -0
- data/xsl/xhtml/html-rtf.xsl +321 -0
- data/xsl/xhtml/html.xsl +690 -0
- data/xsl/xhtml/htmltbl.xsl +102 -0
- data/xsl/xhtml/index.xsl +264 -0
- data/xsl/xhtml/info.xsl +48 -0
- data/xsl/xhtml/inline.xsl +1508 -0
- data/xsl/xhtml/its.xsl +109 -0
- data/xsl/xhtml/keywords.xsl +38 -0
- data/xsl/xhtml/lists.xsl +1227 -0
- data/xsl/xhtml/math.xsl +286 -0
- data/xsl/xhtml/param.xsl +449 -0
- data/xsl/xhtml/pi.xsl +1237 -0
- data/xsl/xhtml/qandaset.xsl +440 -0
- data/xsl/xhtml/refentry.xsl +307 -0
- data/xsl/xhtml/sections.xsl +564 -0
- data/xsl/xhtml/synop.xsl +1623 -0
- data/xsl/xhtml/table.xsl +1179 -0
- data/xsl/xhtml/task.xsl +76 -0
- data/xsl/xhtml/titlepage.templates.xsl +4005 -0
- data/xsl/xhtml/titlepage.xsl +1108 -0
- data/xsl/xhtml/toc.xsl +334 -0
- data/xsl/xhtml/verbatim.xsl +389 -0
- data/xsl/xhtml/xref.xsl +1268 -0
- data/xsl/xhtml5/docbook.xsl +22 -0
- data/xsl/xhtml5/html5-chunk-mods.xsl +112 -0
- data/xsl/xhtml5/html5-element-mods.xsl +791 -0
- data/xsl/xhtml5/xhtml-docbook.xsl +531 -0
- metadata +207 -27
- data/.rvmrc +0 -48
- data/xslt/obfuscate.xsl +0 -12
|
@@ -0,0 +1,706 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="ASCII"?>
|
|
2
|
+
<!--This file was created automatically by html2xhtml-->
|
|
3
|
+
<!--from the HTML stylesheets.-->
|
|
4
|
+
<xsl:stylesheet exclude-result-prefixes="d"
|
|
5
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://docbook.org/ns/docbook"
|
|
6
|
+
xmlns="http://www.w3.org/1999/xhtml" version="1.0">
|
|
7
|
+
|
|
8
|
+
<!-- ********************************************************************
|
|
9
|
+
$Id: autotoc.xsl 9692 2012-12-16 02:31:34Z dcramer $
|
|
10
|
+
********************************************************************
|
|
11
|
+
|
|
12
|
+
This file is part of the XSL DocBook Stylesheet distribution.
|
|
13
|
+
See ../README or http://docbook.sf.net/release/xsl/current/ for
|
|
14
|
+
copyright and other information.
|
|
15
|
+
|
|
16
|
+
******************************************************************** -->
|
|
17
|
+
|
|
18
|
+
<xsl:variable name="toc.listitem.type">
|
|
19
|
+
<xsl:choose>
|
|
20
|
+
<xsl:when test="$toc.list.type = 'dl'">dt</xsl:when>
|
|
21
|
+
<xsl:otherwise>li</xsl:otherwise>
|
|
22
|
+
</xsl:choose>
|
|
23
|
+
</xsl:variable>
|
|
24
|
+
|
|
25
|
+
<!-- this is just hack because dl and ul aren't completely isomorphic -->
|
|
26
|
+
<xsl:variable name="toc.dd.type">
|
|
27
|
+
<xsl:choose>
|
|
28
|
+
<xsl:when test="$toc.list.type = 'dl'">dd</xsl:when>
|
|
29
|
+
<xsl:otherwise/>
|
|
30
|
+
</xsl:choose>
|
|
31
|
+
</xsl:variable>
|
|
32
|
+
|
|
33
|
+
<xsl:template name="make.toc">
|
|
34
|
+
<xsl:param name="toc-context" select="."/>
|
|
35
|
+
<xsl:param name="toc.title.p" select="true()"/>
|
|
36
|
+
<xsl:param name="nodes" select="/NOT-AN-ELEMENT"/>
|
|
37
|
+
|
|
38
|
+
<xsl:variable name="nodes.plus" select="$nodes | d:qandaset"/>
|
|
39
|
+
|
|
40
|
+
<xsl:variable name="toc.title">
|
|
41
|
+
<xsl:if test="$toc.title.p">
|
|
42
|
+
<xsl:choose>
|
|
43
|
+
<xsl:when test="$make.clean.html != 0">
|
|
44
|
+
<div class="toc-title">
|
|
45
|
+
<xsl:call-template name="gentext">
|
|
46
|
+
<xsl:with-param name="key">TableofContents</xsl:with-param>
|
|
47
|
+
</xsl:call-template>
|
|
48
|
+
</div>
|
|
49
|
+
</xsl:when>
|
|
50
|
+
<xsl:otherwise>
|
|
51
|
+
<p>
|
|
52
|
+
<strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
|
|
53
|
+
<xsl:call-template name="gentext">
|
|
54
|
+
<xsl:with-param name="key">TableofContents</xsl:with-param>
|
|
55
|
+
</xsl:call-template>
|
|
56
|
+
</strong>
|
|
57
|
+
</p>
|
|
58
|
+
</xsl:otherwise>
|
|
59
|
+
</xsl:choose>
|
|
60
|
+
</xsl:if>
|
|
61
|
+
</xsl:variable>
|
|
62
|
+
|
|
63
|
+
<xsl:choose>
|
|
64
|
+
<xsl:when test="$manual.toc != ''">
|
|
65
|
+
<xsl:variable name="id">
|
|
66
|
+
<xsl:call-template name="object.id"/>
|
|
67
|
+
</xsl:variable>
|
|
68
|
+
<xsl:variable name="toc" select="document($manual.toc, .)"/>
|
|
69
|
+
<xsl:variable name="tocentry" select="$toc//d:tocentry[@linkend=$id]"/>
|
|
70
|
+
<xsl:if test="$tocentry and $tocentry/*">
|
|
71
|
+
<div class="toc">
|
|
72
|
+
<xsl:copy-of select="$toc.title"/>
|
|
73
|
+
<xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
|
|
74
|
+
<xsl:call-template name="toc.list.attributes">
|
|
75
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
76
|
+
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
|
|
77
|
+
<xsl:with-param name="nodes" select="$nodes"/>
|
|
78
|
+
</xsl:call-template>
|
|
79
|
+
<xsl:call-template name="manual-toc">
|
|
80
|
+
<xsl:with-param name="tocentry" select="$tocentry/*[1]"/>
|
|
81
|
+
</xsl:call-template>
|
|
82
|
+
</xsl:element>
|
|
83
|
+
</div>
|
|
84
|
+
</xsl:if>
|
|
85
|
+
</xsl:when>
|
|
86
|
+
<xsl:otherwise>
|
|
87
|
+
<xsl:choose>
|
|
88
|
+
<xsl:when test="$qanda.in.toc != 0">
|
|
89
|
+
<xsl:if test="$nodes.plus">
|
|
90
|
+
<div class="toc">
|
|
91
|
+
<xsl:copy-of select="$toc.title"/>
|
|
92
|
+
<xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
|
|
93
|
+
<xsl:call-template name="toc.list.attributes">
|
|
94
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
95
|
+
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
|
|
96
|
+
<xsl:with-param name="nodes" select="$nodes"/>
|
|
97
|
+
</xsl:call-template>
|
|
98
|
+
<xsl:apply-templates select="$nodes.plus" mode="toc">
|
|
99
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
100
|
+
</xsl:apply-templates>
|
|
101
|
+
</xsl:element>
|
|
102
|
+
</div>
|
|
103
|
+
</xsl:if>
|
|
104
|
+
</xsl:when>
|
|
105
|
+
<xsl:otherwise>
|
|
106
|
+
<xsl:if test="$nodes">
|
|
107
|
+
<div class="toc">
|
|
108
|
+
<xsl:copy-of select="$toc.title"/>
|
|
109
|
+
<xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
|
|
110
|
+
<xsl:call-template name="toc.list.attributes">
|
|
111
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
112
|
+
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
|
|
113
|
+
<xsl:with-param name="nodes" select="$nodes"/>
|
|
114
|
+
</xsl:call-template>
|
|
115
|
+
<xsl:apply-templates select="$nodes" mode="toc">
|
|
116
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
117
|
+
</xsl:apply-templates>
|
|
118
|
+
</xsl:element>
|
|
119
|
+
</div>
|
|
120
|
+
</xsl:if>
|
|
121
|
+
</xsl:otherwise>
|
|
122
|
+
</xsl:choose>
|
|
123
|
+
|
|
124
|
+
</xsl:otherwise>
|
|
125
|
+
</xsl:choose>
|
|
126
|
+
</xsl:template>
|
|
127
|
+
|
|
128
|
+
<xsl:template name="toc.list.attributes">
|
|
129
|
+
<xsl:param name="toc-context" select="."/>
|
|
130
|
+
<xsl:param name="toc.title.p" select="true()"/>
|
|
131
|
+
<xsl:param name="nodes" select="/NOT-AN-ELEMENT"/>
|
|
132
|
+
|
|
133
|
+
<xsl:attribute name="class">toc</xsl:attribute>
|
|
134
|
+
</xsl:template>
|
|
135
|
+
|
|
136
|
+
<xsl:template name="make.lots">
|
|
137
|
+
<xsl:param name="toc.params" select="''"/>
|
|
138
|
+
<xsl:param name="toc"/>
|
|
139
|
+
|
|
140
|
+
<xsl:if test="contains($toc.params, 'toc')">
|
|
141
|
+
<xsl:copy-of select="$toc"/>
|
|
142
|
+
</xsl:if>
|
|
143
|
+
|
|
144
|
+
<xsl:if test="contains($toc.params, 'figure')">
|
|
145
|
+
<xsl:call-template name="list.of.titles">
|
|
146
|
+
<xsl:with-param name="titles" select="'figure'"/>
|
|
147
|
+
<xsl:with-param name="nodes" select=".//d:figure"/>
|
|
148
|
+
</xsl:call-template>
|
|
149
|
+
</xsl:if>
|
|
150
|
+
|
|
151
|
+
<xsl:if test="contains($toc.params, 'table')">
|
|
152
|
+
<xsl:call-template name="list.of.titles">
|
|
153
|
+
<xsl:with-param name="titles" select="'table'"/>
|
|
154
|
+
<xsl:with-param name="nodes" select=".//d:table[not(@tocentry = 0)]"/>
|
|
155
|
+
</xsl:call-template>
|
|
156
|
+
</xsl:if>
|
|
157
|
+
|
|
158
|
+
<xsl:if test="contains($toc.params, 'example')">
|
|
159
|
+
<xsl:call-template name="list.of.titles">
|
|
160
|
+
<xsl:with-param name="titles" select="'example'"/>
|
|
161
|
+
<xsl:with-param name="nodes" select=".//d:example"/>
|
|
162
|
+
</xsl:call-template>
|
|
163
|
+
</xsl:if>
|
|
164
|
+
|
|
165
|
+
<xsl:if test="contains($toc.params, 'equation')">
|
|
166
|
+
<xsl:call-template name="list.of.titles">
|
|
167
|
+
<xsl:with-param name="titles" select="'equation'"/>
|
|
168
|
+
<xsl:with-param name="nodes" select=".//d:equation[d:title or d:info/d:title]"/>
|
|
169
|
+
</xsl:call-template>
|
|
170
|
+
</xsl:if>
|
|
171
|
+
|
|
172
|
+
<xsl:if test="contains($toc.params, 'procedure')">
|
|
173
|
+
<xsl:call-template name="list.of.titles">
|
|
174
|
+
<xsl:with-param name="titles" select="'procedure'"/>
|
|
175
|
+
<xsl:with-param name="nodes" select=".//d:procedure[d:title]"/>
|
|
176
|
+
</xsl:call-template>
|
|
177
|
+
</xsl:if>
|
|
178
|
+
</xsl:template>
|
|
179
|
+
|
|
180
|
+
<!-- ====================================================================== -->
|
|
181
|
+
|
|
182
|
+
<xsl:template name="set.toc">
|
|
183
|
+
<xsl:param name="toc-context" select="."/>
|
|
184
|
+
<xsl:param name="toc.title.p" select="true()"/>
|
|
185
|
+
|
|
186
|
+
<xsl:call-template name="make.toc">
|
|
187
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
188
|
+
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
|
|
189
|
+
<xsl:with-param name="nodes" select="d:book|d:setindex|d:set"/>
|
|
190
|
+
</xsl:call-template>
|
|
191
|
+
</xsl:template>
|
|
192
|
+
|
|
193
|
+
<xsl:template name="division.toc">
|
|
194
|
+
<xsl:param name="toc-context" select="."/>
|
|
195
|
+
<xsl:param name="toc.title.p" select="true()"/>
|
|
196
|
+
|
|
197
|
+
<xsl:call-template name="make.toc">
|
|
198
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
199
|
+
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
|
|
200
|
+
<xsl:with-param name="nodes" select="d:part|d:reference |d:preface|d:chapter|d:appendix |d:article |d:topic |d:bibliography|d:glossary|d:index |d:refentry |d:bridgehead[$bridgehead.in.toc != 0]"/>
|
|
201
|
+
|
|
202
|
+
</xsl:call-template>
|
|
203
|
+
</xsl:template>
|
|
204
|
+
|
|
205
|
+
<xsl:template name="component.toc">
|
|
206
|
+
<xsl:param name="toc-context" select="."/>
|
|
207
|
+
<xsl:param name="toc.title.p" select="true()"/>
|
|
208
|
+
|
|
209
|
+
<xsl:call-template name="make.toc">
|
|
210
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
211
|
+
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
|
|
212
|
+
<xsl:with-param name="nodes" select="d:section|d:sect1 |d:simplesect[$simplesect.in.toc != 0] |d:topic |d:refentry |d:article|d:bibliography|d:glossary |d:appendix|d:index |d:bridgehead[not(@renderas) and $bridgehead.in.toc != 0] |.//d:bridgehead[@renderas='sect1' and $bridgehead.in.toc != 0]"/>
|
|
213
|
+
</xsl:call-template>
|
|
214
|
+
</xsl:template>
|
|
215
|
+
|
|
216
|
+
<xsl:template name="component.toc.separator">
|
|
217
|
+
<!-- Customize to output something between
|
|
218
|
+
component.toc and first output -->
|
|
219
|
+
</xsl:template>
|
|
220
|
+
|
|
221
|
+
<xsl:template name="section.toc">
|
|
222
|
+
<xsl:param name="toc-context" select="."/>
|
|
223
|
+
<xsl:param name="toc.title.p" select="true()"/>
|
|
224
|
+
|
|
225
|
+
<xsl:call-template name="make.toc">
|
|
226
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
227
|
+
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
|
|
228
|
+
<xsl:with-param name="nodes" select="d:section|d:sect1|d:sect2|d:sect3|d:sect4|d:sect5|d:refentry |d:bridgehead[$bridgehead.in.toc != 0]"/>
|
|
229
|
+
|
|
230
|
+
</xsl:call-template>
|
|
231
|
+
</xsl:template>
|
|
232
|
+
|
|
233
|
+
<xsl:template name="section.toc.separator">
|
|
234
|
+
<!-- Customize to output something between
|
|
235
|
+
section.toc and first output -->
|
|
236
|
+
</xsl:template>
|
|
237
|
+
<!-- ==================================================================== -->
|
|
238
|
+
|
|
239
|
+
<xsl:template name="subtoc">
|
|
240
|
+
<xsl:param name="toc-context" select="."/>
|
|
241
|
+
<xsl:param name="nodes" select="NOT-AN-ELEMENT"/>
|
|
242
|
+
|
|
243
|
+
<xsl:variable name="nodes.plus" select="$nodes | d:qandaset"/>
|
|
244
|
+
|
|
245
|
+
<xsl:variable name="subtoc">
|
|
246
|
+
<xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
|
|
247
|
+
<xsl:choose>
|
|
248
|
+
<xsl:when test="$qanda.in.toc != 0">
|
|
249
|
+
<xsl:apply-templates mode="toc" select="$nodes.plus">
|
|
250
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
251
|
+
</xsl:apply-templates>
|
|
252
|
+
</xsl:when>
|
|
253
|
+
<xsl:otherwise>
|
|
254
|
+
<xsl:apply-templates mode="toc" select="$nodes">
|
|
255
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
256
|
+
</xsl:apply-templates>
|
|
257
|
+
</xsl:otherwise>
|
|
258
|
+
</xsl:choose>
|
|
259
|
+
</xsl:element>
|
|
260
|
+
</xsl:variable>
|
|
261
|
+
|
|
262
|
+
<xsl:variable name="depth">
|
|
263
|
+
<xsl:choose>
|
|
264
|
+
<xsl:when test="local-name(.) = 'section'">
|
|
265
|
+
<xsl:value-of select="count(ancestor::d:section) + 1"/>
|
|
266
|
+
</xsl:when>
|
|
267
|
+
<xsl:when test="local-name(.) = 'sect1'">1</xsl:when>
|
|
268
|
+
<xsl:when test="local-name(.) = 'sect2'">2</xsl:when>
|
|
269
|
+
<xsl:when test="local-name(.) = 'sect3'">3</xsl:when>
|
|
270
|
+
<xsl:when test="local-name(.) = 'sect4'">4</xsl:when>
|
|
271
|
+
<xsl:when test="local-name(.) = 'sect5'">5</xsl:when>
|
|
272
|
+
<xsl:when test="local-name(.) = 'refsect1'">1</xsl:when>
|
|
273
|
+
<xsl:when test="local-name(.) = 'refsect2'">2</xsl:when>
|
|
274
|
+
<xsl:when test="local-name(.) = 'refsect3'">3</xsl:when>
|
|
275
|
+
<xsl:when test="local-name(.) = 'topic'">1</xsl:when>
|
|
276
|
+
<xsl:when test="local-name(.) = 'simplesect'">
|
|
277
|
+
<!-- sigh... -->
|
|
278
|
+
<xsl:choose>
|
|
279
|
+
<xsl:when test="local-name(..) = 'section'">
|
|
280
|
+
<xsl:value-of select="count(ancestor::d:section)"/>
|
|
281
|
+
</xsl:when>
|
|
282
|
+
<xsl:when test="local-name(..) = 'sect1'">2</xsl:when>
|
|
283
|
+
<xsl:when test="local-name(..) = 'sect2'">3</xsl:when>
|
|
284
|
+
<xsl:when test="local-name(..) = 'sect3'">4</xsl:when>
|
|
285
|
+
<xsl:when test="local-name(..) = 'sect4'">5</xsl:when>
|
|
286
|
+
<xsl:when test="local-name(..) = 'sect5'">6</xsl:when>
|
|
287
|
+
<xsl:when test="local-name(..) = 'topic'">2</xsl:when>
|
|
288
|
+
<xsl:when test="local-name(..) = 'refsect1'">2</xsl:when>
|
|
289
|
+
<xsl:when test="local-name(..) = 'refsect2'">3</xsl:when>
|
|
290
|
+
<xsl:when test="local-name(..) = 'refsect3'">4</xsl:when>
|
|
291
|
+
<xsl:otherwise>1</xsl:otherwise>
|
|
292
|
+
</xsl:choose>
|
|
293
|
+
</xsl:when>
|
|
294
|
+
<xsl:otherwise>0</xsl:otherwise>
|
|
295
|
+
</xsl:choose>
|
|
296
|
+
</xsl:variable>
|
|
297
|
+
|
|
298
|
+
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
|
|
299
|
+
|
|
300
|
+
<xsl:variable name="subtoc.list">
|
|
301
|
+
<xsl:choose>
|
|
302
|
+
<xsl:when test="$toc.dd.type = ''">
|
|
303
|
+
<xsl:copy-of select="$subtoc"/>
|
|
304
|
+
</xsl:when>
|
|
305
|
+
<xsl:otherwise>
|
|
306
|
+
<xsl:element name="{$toc.dd.type}" namespace="http://www.w3.org/1999/xhtml">
|
|
307
|
+
<xsl:copy-of select="$subtoc"/>
|
|
308
|
+
</xsl:element>
|
|
309
|
+
</xsl:otherwise>
|
|
310
|
+
</xsl:choose>
|
|
311
|
+
</xsl:variable>
|
|
312
|
+
|
|
313
|
+
<xsl:element name="{$toc.listitem.type}" namespace="http://www.w3.org/1999/xhtml">
|
|
314
|
+
<xsl:call-template name="toc.line">
|
|
315
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
316
|
+
</xsl:call-template>
|
|
317
|
+
<xsl:if test="$toc.listitem.type = 'li' and ( (self::d:set or self::d:book or self::d:part) or $toc.section.depth > $depth) and ( ($qanda.in.toc = 0 and count($nodes)>0) or ($qanda.in.toc != 0 and count($nodes.plus)>0) ) and $toc.max.depth > $depth.from.context">
|
|
318
|
+
<xsl:copy-of select="$subtoc.list"/>
|
|
319
|
+
</xsl:if>
|
|
320
|
+
</xsl:element>
|
|
321
|
+
<xsl:if test="$toc.listitem.type != 'li' and ( (self::d:set or self::d:book or self::d:part) or $toc.section.depth > $depth) and ( ($qanda.in.toc = 0 and count($nodes)>0) or ($qanda.in.toc != 0 and count($nodes.plus)>0) ) and $toc.max.depth > $depth.from.context">
|
|
322
|
+
<xsl:copy-of select="$subtoc.list"/>
|
|
323
|
+
</xsl:if>
|
|
324
|
+
</xsl:template>
|
|
325
|
+
|
|
326
|
+
<xsl:template name="toc.line">
|
|
327
|
+
<xsl:param name="toc-context" select="."/>
|
|
328
|
+
<xsl:param name="depth" select="1"/>
|
|
329
|
+
<xsl:param name="depth.from.context" select="8"/>
|
|
330
|
+
|
|
331
|
+
<span>
|
|
332
|
+
<xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
|
|
333
|
+
|
|
334
|
+
<!-- * if $autotoc.label.in.hyperlink is zero, then output the label -->
|
|
335
|
+
<!-- * before the hyperlinked title (as the DSSSL stylesheet does) -->
|
|
336
|
+
<xsl:if test="$autotoc.label.in.hyperlink = 0">
|
|
337
|
+
<xsl:variable name="label">
|
|
338
|
+
<xsl:apply-templates select="." mode="label.markup"/>
|
|
339
|
+
</xsl:variable>
|
|
340
|
+
<xsl:copy-of select="$label"/>
|
|
341
|
+
<xsl:if test="$label != ''">
|
|
342
|
+
<xsl:value-of select="$autotoc.label.separator"/>
|
|
343
|
+
</xsl:if>
|
|
344
|
+
</xsl:if>
|
|
345
|
+
|
|
346
|
+
<a>
|
|
347
|
+
<xsl:attribute name="href">
|
|
348
|
+
<xsl:call-template name="href.target">
|
|
349
|
+
<xsl:with-param name="context" select="$toc-context"/>
|
|
350
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
351
|
+
</xsl:call-template>
|
|
352
|
+
</xsl:attribute>
|
|
353
|
+
|
|
354
|
+
<!-- * if $autotoc.label.in.hyperlink is non-zero, then output the label -->
|
|
355
|
+
<!-- * as part of the hyperlinked title -->
|
|
356
|
+
<xsl:if test="not($autotoc.label.in.hyperlink = 0)">
|
|
357
|
+
<xsl:variable name="label">
|
|
358
|
+
<xsl:apply-templates select="." mode="label.markup"/>
|
|
359
|
+
</xsl:variable>
|
|
360
|
+
<xsl:copy-of select="$label"/>
|
|
361
|
+
<xsl:if test="$label != ''">
|
|
362
|
+
<xsl:value-of select="$autotoc.label.separator"/>
|
|
363
|
+
</xsl:if>
|
|
364
|
+
</xsl:if>
|
|
365
|
+
|
|
366
|
+
<xsl:apply-templates select="." mode="titleabbrev.markup"/>
|
|
367
|
+
</a>
|
|
368
|
+
</span>
|
|
369
|
+
</xsl:template>
|
|
370
|
+
|
|
371
|
+
<xsl:template match="d:book" mode="toc">
|
|
372
|
+
<xsl:param name="toc-context" select="."/>
|
|
373
|
+
|
|
374
|
+
<xsl:call-template name="subtoc">
|
|
375
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
376
|
+
<xsl:with-param name="nodes" select="d:part|d:reference |d:preface|d:chapter|d:appendix |d:article |d:topic |d:bibliography|d:glossary|d:index |d:refentry |d:bridgehead[$bridgehead.in.toc != 0]"/>
|
|
377
|
+
</xsl:call-template>
|
|
378
|
+
</xsl:template>
|
|
379
|
+
|
|
380
|
+
<xsl:template match="d:setindex" mode="toc">
|
|
381
|
+
<xsl:param name="toc-context" select="."/>
|
|
382
|
+
|
|
383
|
+
<!-- If the setindex tag is not empty, it should be it in the TOC -->
|
|
384
|
+
<xsl:if test="* or $generate.index != 0">
|
|
385
|
+
<xsl:call-template name="subtoc">
|
|
386
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
387
|
+
</xsl:call-template>
|
|
388
|
+
</xsl:if>
|
|
389
|
+
</xsl:template>
|
|
390
|
+
|
|
391
|
+
<xsl:template match="d:part|d:reference" mode="toc">
|
|
392
|
+
<xsl:param name="toc-context" select="."/>
|
|
393
|
+
|
|
394
|
+
<xsl:call-template name="subtoc">
|
|
395
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
396
|
+
<xsl:with-param name="nodes" select="d:appendix|d:chapter|d:article|d:topic |d:index|d:glossary|d:bibliography |d:preface|d:reference|d:refentry |d:bridgehead[$bridgehead.in.toc != 0]"/>
|
|
397
|
+
</xsl:call-template>
|
|
398
|
+
</xsl:template>
|
|
399
|
+
|
|
400
|
+
<xsl:template match="d:preface|d:chapter|d:appendix|d:article|d:topic" mode="toc">
|
|
401
|
+
<xsl:param name="toc-context" select="."/>
|
|
402
|
+
|
|
403
|
+
<xsl:call-template name="subtoc">
|
|
404
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
405
|
+
<xsl:with-param name="nodes" select="d:section|d:sect1 |d:simplesect[$simplesect.in.toc != 0] |d:topic |d:refentry |d:glossary|d:bibliography|d:index |d:bridgehead[$bridgehead.in.toc != 0]"/>
|
|
406
|
+
</xsl:call-template>
|
|
407
|
+
</xsl:template>
|
|
408
|
+
|
|
409
|
+
<xsl:template match="d:sect1" mode="toc">
|
|
410
|
+
<xsl:param name="toc-context" select="."/>
|
|
411
|
+
<xsl:call-template name="subtoc">
|
|
412
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
413
|
+
<xsl:with-param name="nodes" select="d:sect2 |d:bridgehead[$bridgehead.in.toc != 0]"/>
|
|
414
|
+
</xsl:call-template>
|
|
415
|
+
</xsl:template>
|
|
416
|
+
|
|
417
|
+
<xsl:template match="d:sect2" mode="toc">
|
|
418
|
+
<xsl:param name="toc-context" select="."/>
|
|
419
|
+
|
|
420
|
+
<xsl:call-template name="subtoc">
|
|
421
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
422
|
+
<xsl:with-param name="nodes" select="d:sect3 |d:bridgehead[$bridgehead.in.toc != 0]"/>
|
|
423
|
+
</xsl:call-template>
|
|
424
|
+
</xsl:template>
|
|
425
|
+
|
|
426
|
+
<xsl:template match="d:sect3" mode="toc">
|
|
427
|
+
<xsl:param name="toc-context" select="."/>
|
|
428
|
+
|
|
429
|
+
<xsl:call-template name="subtoc">
|
|
430
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
431
|
+
<xsl:with-param name="nodes" select="d:sect4 |d:bridgehead[$bridgehead.in.toc != 0]"/>
|
|
432
|
+
</xsl:call-template>
|
|
433
|
+
</xsl:template>
|
|
434
|
+
|
|
435
|
+
<xsl:template match="d:sect4" mode="toc">
|
|
436
|
+
<xsl:param name="toc-context" select="."/>
|
|
437
|
+
|
|
438
|
+
<xsl:call-template name="subtoc">
|
|
439
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
440
|
+
<xsl:with-param name="nodes" select="d:sect5 |d:bridgehead[$bridgehead.in.toc != 0]"/>
|
|
441
|
+
</xsl:call-template>
|
|
442
|
+
</xsl:template>
|
|
443
|
+
|
|
444
|
+
<xsl:template match="d:sect5" mode="toc">
|
|
445
|
+
<xsl:param name="toc-context" select="."/>
|
|
446
|
+
|
|
447
|
+
<xsl:call-template name="subtoc">
|
|
448
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
449
|
+
</xsl:call-template>
|
|
450
|
+
</xsl:template>
|
|
451
|
+
|
|
452
|
+
<xsl:template match="d:simplesect" mode="toc">
|
|
453
|
+
<xsl:param name="toc-context" select="."/>
|
|
454
|
+
|
|
455
|
+
<xsl:call-template name="subtoc">
|
|
456
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
457
|
+
</xsl:call-template>
|
|
458
|
+
</xsl:template>
|
|
459
|
+
|
|
460
|
+
<xsl:template match="d:section" mode="toc">
|
|
461
|
+
<xsl:param name="toc-context" select="."/>
|
|
462
|
+
|
|
463
|
+
<xsl:call-template name="subtoc">
|
|
464
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
465
|
+
<xsl:with-param name="nodes" select="d:section|d:refentry |d:simplesect[$simplesect.in.toc != 0] |d:bridgehead[$bridgehead.in.toc != 0]"/>
|
|
466
|
+
</xsl:call-template>
|
|
467
|
+
</xsl:template>
|
|
468
|
+
|
|
469
|
+
<xsl:template match="d:topic" mode="toc">
|
|
470
|
+
<xsl:param name="toc-context" select="."/>
|
|
471
|
+
|
|
472
|
+
<xsl:call-template name="subtoc">
|
|
473
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
474
|
+
<xsl:with-param name="nodes" select="d:section|d:refentry |d:simplesect[$simplesect.in.toc != 0] |d:bridgehead[$bridgehead.in.toc != 0]"/>
|
|
475
|
+
</xsl:call-template>
|
|
476
|
+
</xsl:template>
|
|
477
|
+
|
|
478
|
+
<xsl:template match="d:bridgehead" mode="toc">
|
|
479
|
+
<xsl:param name="toc-context" select="."/>
|
|
480
|
+
|
|
481
|
+
<xsl:if test="$bridgehead.in.toc != 0">
|
|
482
|
+
<xsl:call-template name="subtoc">
|
|
483
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
484
|
+
</xsl:call-template>
|
|
485
|
+
</xsl:if>
|
|
486
|
+
</xsl:template>
|
|
487
|
+
|
|
488
|
+
<xsl:template match="d:bibliography|d:glossary" mode="toc">
|
|
489
|
+
<xsl:param name="toc-context" select="."/>
|
|
490
|
+
|
|
491
|
+
<xsl:call-template name="subtoc">
|
|
492
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
493
|
+
</xsl:call-template>
|
|
494
|
+
</xsl:template>
|
|
495
|
+
|
|
496
|
+
<xsl:template match="d:index" mode="toc">
|
|
497
|
+
<xsl:param name="toc-context" select="."/>
|
|
498
|
+
|
|
499
|
+
<!-- If the index tag is not empty, it should be it in the TOC -->
|
|
500
|
+
<xsl:if test="* or $generate.index != 0">
|
|
501
|
+
<xsl:call-template name="subtoc">
|
|
502
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
503
|
+
</xsl:call-template>
|
|
504
|
+
</xsl:if>
|
|
505
|
+
</xsl:template>
|
|
506
|
+
|
|
507
|
+
<xsl:template match="d:refentry" mode="toc">
|
|
508
|
+
<xsl:param name="toc-context" select="."/>
|
|
509
|
+
|
|
510
|
+
<xsl:variable name="refmeta" select=".//d:refmeta"/>
|
|
511
|
+
<xsl:variable name="refentrytitle" select="$refmeta//d:refentrytitle"/>
|
|
512
|
+
<xsl:variable name="refnamediv" select=".//d:refnamediv"/>
|
|
513
|
+
<xsl:variable name="refname" select="$refnamediv//d:refname"/>
|
|
514
|
+
<xsl:variable name="refdesc" select="$refnamediv//d:refdescriptor"/>
|
|
515
|
+
<xsl:variable name="title">
|
|
516
|
+
<xsl:choose>
|
|
517
|
+
<xsl:when test="$refentrytitle">
|
|
518
|
+
<xsl:apply-templates select="$refentrytitle[1]" mode="titleabbrev.markup"/>
|
|
519
|
+
</xsl:when>
|
|
520
|
+
<xsl:when test="$refdesc">
|
|
521
|
+
<xsl:apply-templates select="$refdesc" mode="titleabbrev.markup"/>
|
|
522
|
+
</xsl:when>
|
|
523
|
+
<xsl:when test="$refname">
|
|
524
|
+
<xsl:apply-templates select="$refname[1]" mode="titleabbrev.markup"/>
|
|
525
|
+
</xsl:when>
|
|
526
|
+
</xsl:choose>
|
|
527
|
+
</xsl:variable>
|
|
528
|
+
|
|
529
|
+
<xsl:element name="{$toc.listitem.type}" namespace="http://www.w3.org/1999/xhtml">
|
|
530
|
+
<span class="refentrytitle">
|
|
531
|
+
<a>
|
|
532
|
+
<xsl:attribute name="href">
|
|
533
|
+
<xsl:call-template name="href.target">
|
|
534
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
535
|
+
</xsl:call-template>
|
|
536
|
+
</xsl:attribute>
|
|
537
|
+
<xsl:copy-of select="$title"/>
|
|
538
|
+
</a>
|
|
539
|
+
</span>
|
|
540
|
+
<span class="refpurpose">
|
|
541
|
+
<xsl:if test="$annotate.toc != 0">
|
|
542
|
+
<!-- * DocBook 5 says inlinemediaobject (among other things) -->
|
|
543
|
+
<!-- * is allowed in refpurpose; so we need to run -->
|
|
544
|
+
<!-- * apply-templates on refpurpose here, instead of value-of -->
|
|
545
|
+
<xsl:apply-templates select="d:refnamediv/d:refpurpose" mode="no.anchor.mode"/>
|
|
546
|
+
</xsl:if>
|
|
547
|
+
</span>
|
|
548
|
+
</xsl:element>
|
|
549
|
+
</xsl:template>
|
|
550
|
+
|
|
551
|
+
<xsl:template match="d:title" mode="toc">
|
|
552
|
+
<xsl:param name="toc-context" select="."/>
|
|
553
|
+
|
|
554
|
+
<a>
|
|
555
|
+
<xsl:attribute name="href">
|
|
556
|
+
<xsl:call-template name="href.target">
|
|
557
|
+
<xsl:with-param name="object" select=".."/>
|
|
558
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
559
|
+
</xsl:call-template>
|
|
560
|
+
</xsl:attribute>
|
|
561
|
+
<xsl:apply-templates/>
|
|
562
|
+
</a>
|
|
563
|
+
</xsl:template>
|
|
564
|
+
|
|
565
|
+
<xsl:template name="manual-toc">
|
|
566
|
+
<xsl:param name="toc-context" select="."/>
|
|
567
|
+
<xsl:param name="tocentry"/>
|
|
568
|
+
<xsl:param name="toc.title.p" select="true()"/>
|
|
569
|
+
<xsl:param name="nodes" select="/NOT-AN-ELEMENT"/>
|
|
570
|
+
|
|
571
|
+
<!-- be careful, we don't want to change the current document to the other tree! -->
|
|
572
|
+
|
|
573
|
+
<xsl:if test="$tocentry">
|
|
574
|
+
<xsl:variable name="node" select="key('id', $tocentry/@linkend)"/>
|
|
575
|
+
|
|
576
|
+
<xsl:element name="{$toc.listitem.type}" namespace="http://www.w3.org/1999/xhtml">
|
|
577
|
+
<xsl:variable name="label">
|
|
578
|
+
<xsl:apply-templates select="$node" mode="label.markup"/>
|
|
579
|
+
</xsl:variable>
|
|
580
|
+
<xsl:copy-of select="$label"/>
|
|
581
|
+
<xsl:if test="$label != ''">
|
|
582
|
+
<xsl:value-of select="$autotoc.label.separator"/>
|
|
583
|
+
</xsl:if>
|
|
584
|
+
<a>
|
|
585
|
+
<xsl:attribute name="href">
|
|
586
|
+
<xsl:call-template name="href.target">
|
|
587
|
+
<xsl:with-param name="object" select="$node"/>
|
|
588
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
589
|
+
</xsl:call-template>
|
|
590
|
+
</xsl:attribute>
|
|
591
|
+
<xsl:apply-templates select="$node" mode="titleabbrev.markup"/>
|
|
592
|
+
</a>
|
|
593
|
+
</xsl:element>
|
|
594
|
+
|
|
595
|
+
<xsl:if test="$tocentry/*">
|
|
596
|
+
<xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
|
|
597
|
+
<xsl:call-template name="toc.list.attributes">
|
|
598
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
599
|
+
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
|
|
600
|
+
<xsl:with-param name="nodes" select="$nodes"/>
|
|
601
|
+
</xsl:call-template>
|
|
602
|
+
<xsl:call-template name="manual-toc">
|
|
603
|
+
<xsl:with-param name="tocentry" select="$tocentry/*[1]"/>
|
|
604
|
+
</xsl:call-template>
|
|
605
|
+
</xsl:element>
|
|
606
|
+
</xsl:if>
|
|
607
|
+
|
|
608
|
+
<xsl:if test="$tocentry/following-sibling::*">
|
|
609
|
+
<xsl:call-template name="manual-toc">
|
|
610
|
+
<xsl:with-param name="tocentry" select="$tocentry/following-sibling::*[1]"/>
|
|
611
|
+
</xsl:call-template>
|
|
612
|
+
</xsl:if>
|
|
613
|
+
</xsl:if>
|
|
614
|
+
</xsl:template>
|
|
615
|
+
|
|
616
|
+
<!-- ==================================================================== -->
|
|
617
|
+
|
|
618
|
+
<xsl:template name="list.of.titles">
|
|
619
|
+
<xsl:param name="toc-context" select="."/>
|
|
620
|
+
<xsl:param name="titles" select="'table'"/>
|
|
621
|
+
<xsl:param name="nodes" select=".//d:table"/>
|
|
622
|
+
|
|
623
|
+
<xsl:if test="$nodes">
|
|
624
|
+
<div class="list-of-{$titles}s">
|
|
625
|
+
<xsl:choose>
|
|
626
|
+
<xsl:when test="$make.clean.html != 0">
|
|
627
|
+
<div class="toc-title">
|
|
628
|
+
<xsl:call-template name="gentext">
|
|
629
|
+
<xsl:with-param name="key">
|
|
630
|
+
<xsl:choose>
|
|
631
|
+
<xsl:when test="$titles='table'">ListofTables</xsl:when>
|
|
632
|
+
<xsl:when test="$titles='figure'">ListofFigures</xsl:when>
|
|
633
|
+
<xsl:when test="$titles='equation'">ListofEquations</xsl:when>
|
|
634
|
+
<xsl:when test="$titles='example'">ListofExamples</xsl:when>
|
|
635
|
+
<xsl:when test="$titles='procedure'">ListofProcedures</xsl:when>
|
|
636
|
+
<xsl:otherwise>ListofUnknown</xsl:otherwise>
|
|
637
|
+
</xsl:choose>
|
|
638
|
+
</xsl:with-param>
|
|
639
|
+
</xsl:call-template>
|
|
640
|
+
</div>
|
|
641
|
+
</xsl:when>
|
|
642
|
+
<xsl:otherwise>
|
|
643
|
+
<p>
|
|
644
|
+
<strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
|
|
645
|
+
<xsl:call-template name="gentext">
|
|
646
|
+
<xsl:with-param name="key">
|
|
647
|
+
<xsl:choose>
|
|
648
|
+
<xsl:when test="$titles='table'">ListofTables</xsl:when>
|
|
649
|
+
<xsl:when test="$titles='figure'">ListofFigures</xsl:when>
|
|
650
|
+
<xsl:when test="$titles='equation'">ListofEquations</xsl:when>
|
|
651
|
+
<xsl:when test="$titles='example'">ListofExamples</xsl:when>
|
|
652
|
+
<xsl:when test="$titles='procedure'">ListofProcedures</xsl:when>
|
|
653
|
+
<xsl:otherwise>ListofUnknown</xsl:otherwise>
|
|
654
|
+
</xsl:choose>
|
|
655
|
+
</xsl:with-param>
|
|
656
|
+
</xsl:call-template>
|
|
657
|
+
</strong>
|
|
658
|
+
</p>
|
|
659
|
+
</xsl:otherwise>
|
|
660
|
+
</xsl:choose>
|
|
661
|
+
|
|
662
|
+
<xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
|
|
663
|
+
<xsl:apply-templates select="$nodes" mode="toc">
|
|
664
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
665
|
+
</xsl:apply-templates>
|
|
666
|
+
</xsl:element>
|
|
667
|
+
</div>
|
|
668
|
+
</xsl:if>
|
|
669
|
+
</xsl:template>
|
|
670
|
+
|
|
671
|
+
<xsl:template match="d:figure|d:table|d:example|d:equation|d:procedure" mode="toc">
|
|
672
|
+
<xsl:param name="toc-context" select="."/>
|
|
673
|
+
|
|
674
|
+
<xsl:element name="{$toc.listitem.type}" namespace="http://www.w3.org/1999/xhtml">
|
|
675
|
+
<xsl:variable name="label">
|
|
676
|
+
<xsl:apply-templates select="." mode="label.markup"/>
|
|
677
|
+
</xsl:variable>
|
|
678
|
+
<xsl:copy-of select="$label"/>
|
|
679
|
+
<xsl:if test="$label != ''">
|
|
680
|
+
<xsl:value-of select="$autotoc.label.separator"/>
|
|
681
|
+
</xsl:if>
|
|
682
|
+
<a>
|
|
683
|
+
<xsl:attribute name="href">
|
|
684
|
+
<xsl:call-template name="href.target">
|
|
685
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
686
|
+
</xsl:call-template>
|
|
687
|
+
</xsl:attribute>
|
|
688
|
+
<xsl:apply-templates select="." mode="titleabbrev.markup"/>
|
|
689
|
+
</a>
|
|
690
|
+
</xsl:element>
|
|
691
|
+
</xsl:template>
|
|
692
|
+
|
|
693
|
+
<!-- Used only if qanda.in.toc parameter is non-zero -->
|
|
694
|
+
<xsl:template match="d:qandaset" mode="toc">
|
|
695
|
+
<xsl:param name="toc-context" select="."/>
|
|
696
|
+
<xsl:call-template name="subtoc">
|
|
697
|
+
<xsl:with-param name="toc-context" select="$toc-context"/>
|
|
698
|
+
<xsl:with-param name="nodes" select="d:qandadiv | d:qandaentry"/>
|
|
699
|
+
</xsl:call-template>
|
|
700
|
+
</xsl:template>
|
|
701
|
+
|
|
702
|
+
<xsl:template match="d:qandadiv|d:qandaentry" mode="toc">
|
|
703
|
+
<xsl:apply-templates select="." mode="qandatoc.mode"/>
|
|
704
|
+
</xsl:template>
|
|
705
|
+
|
|
706
|
+
</xsl:stylesheet>
|