docbook_xsl_wrapper 0.1.2 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- 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,850 @@
|
|
1
|
+
<?xml version='1.0'?>
|
2
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
3
|
+
xmlns:d="http://docbook.org/ns/docbook"
|
4
|
+
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
|
5
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
6
|
+
exclude-result-prefixes="doc d"
|
7
|
+
version='1.0'>
|
8
|
+
|
9
|
+
<!-- ********************************************************************
|
10
|
+
$Id: titles.xsl 9826 2013-10-29 05:07:39Z bobstayton $
|
11
|
+
********************************************************************
|
12
|
+
|
13
|
+
This file is part of the XSL DocBook Stylesheet distribution.
|
14
|
+
See ../README or http://docbook.sf.net/release/xsl/current/ for
|
15
|
+
copyright and other information.
|
16
|
+
|
17
|
+
******************************************************************** -->
|
18
|
+
|
19
|
+
<!-- ==================================================================== -->
|
20
|
+
|
21
|
+
<!-- title markup -->
|
22
|
+
|
23
|
+
<doc:mode mode="title.markup" xmlns="">
|
24
|
+
<refpurpose>Provides access to element titles</refpurpose>
|
25
|
+
<refdescription id="title.markup-desc">
|
26
|
+
<para>Processing an element in the
|
27
|
+
<literal role="mode">title.markup</literal> mode produces the
|
28
|
+
title of the element. This does not include the label.
|
29
|
+
</para>
|
30
|
+
</refdescription>
|
31
|
+
</doc:mode>
|
32
|
+
|
33
|
+
<xsl:template match="*" mode="title.markup">
|
34
|
+
<xsl:param name="allow-anchors" select="0"/>
|
35
|
+
<xsl:param name="verbose" select="1"/>
|
36
|
+
<xsl:choose>
|
37
|
+
<!-- * FIXME: this should handle other *info elements as well -->
|
38
|
+
<!-- * but this is good enough for now. -->
|
39
|
+
<xsl:when test="d:title|d:info/d:title">
|
40
|
+
<xsl:apply-templates select="(d:title|d:info/d:title)[1]" mode="title.markup">
|
41
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
42
|
+
</xsl:apply-templates>
|
43
|
+
</xsl:when>
|
44
|
+
<xsl:when test="local-name(.) = 'partintro'">
|
45
|
+
<!-- partintro's don't have titles, use the parent (part or reference)
|
46
|
+
title instead. -->
|
47
|
+
<xsl:apply-templates select="parent::*" mode="title.markup"/>
|
48
|
+
</xsl:when>
|
49
|
+
<xsl:otherwise>
|
50
|
+
<xsl:if test="$verbose != 0">
|
51
|
+
<xsl:message>
|
52
|
+
<xsl:text>Request for title of element with no title: </xsl:text>
|
53
|
+
<xsl:value-of select="local-name(.)"/>
|
54
|
+
<xsl:choose>
|
55
|
+
<xsl:when test="@id">
|
56
|
+
<xsl:text> (id="</xsl:text>
|
57
|
+
<xsl:value-of select="@id"/>
|
58
|
+
<xsl:text>")</xsl:text>
|
59
|
+
</xsl:when>
|
60
|
+
<xsl:when test="@xml:id">
|
61
|
+
<xsl:text> (xml:id="</xsl:text>
|
62
|
+
<xsl:value-of select="@xml:id"/>
|
63
|
+
<xsl:text>")</xsl:text>
|
64
|
+
</xsl:when>
|
65
|
+
<xsl:otherwise>
|
66
|
+
<xsl:text> (contained in </xsl:text>
|
67
|
+
<xsl:value-of select="local-name(..)"/>
|
68
|
+
<xsl:if test="../@id or ../@xml:id">
|
69
|
+
<xsl:text> with id </xsl:text>
|
70
|
+
<xsl:value-of select="../@id | ../@xml:id"/>
|
71
|
+
</xsl:if>
|
72
|
+
<xsl:text>)</xsl:text>
|
73
|
+
</xsl:otherwise>
|
74
|
+
</xsl:choose>
|
75
|
+
</xsl:message>
|
76
|
+
</xsl:if>
|
77
|
+
<xsl:text>???TITLE???</xsl:text>
|
78
|
+
</xsl:otherwise>
|
79
|
+
</xsl:choose>
|
80
|
+
</xsl:template>
|
81
|
+
|
82
|
+
<xsl:template match="d:title" mode="title.markup">
|
83
|
+
<xsl:param name="allow-anchors" select="0"/>
|
84
|
+
|
85
|
+
<xsl:choose>
|
86
|
+
<xsl:when test="$allow-anchors != 0">
|
87
|
+
<xsl:apply-templates/>
|
88
|
+
</xsl:when>
|
89
|
+
<xsl:otherwise>
|
90
|
+
<xsl:apply-templates mode="no.anchor.mode"/>
|
91
|
+
</xsl:otherwise>
|
92
|
+
</xsl:choose>
|
93
|
+
</xsl:template>
|
94
|
+
|
95
|
+
<!-- only occurs in HTML Tables! -->
|
96
|
+
<xsl:template match="d:caption" mode="title.markup">
|
97
|
+
<xsl:param name="allow-anchors" select="0"/>
|
98
|
+
|
99
|
+
<xsl:choose>
|
100
|
+
<xsl:when test="$allow-anchors != 0">
|
101
|
+
<xsl:apply-templates/>
|
102
|
+
</xsl:when>
|
103
|
+
<xsl:otherwise>
|
104
|
+
<xsl:apply-templates mode="no.anchor.mode"/>
|
105
|
+
</xsl:otherwise>
|
106
|
+
</xsl:choose>
|
107
|
+
</xsl:template>
|
108
|
+
|
109
|
+
<xsl:template match="d:set" mode="title.markup">
|
110
|
+
<xsl:param name="allow-anchors" select="0"/>
|
111
|
+
<xsl:apply-templates select="(d:setinfo/d:title|d:info/d:title|d:title)[1]"
|
112
|
+
mode="title.markup">
|
113
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
114
|
+
</xsl:apply-templates>
|
115
|
+
</xsl:template>
|
116
|
+
|
117
|
+
<xsl:template match="d:book" mode="title.markup">
|
118
|
+
<xsl:param name="allow-anchors" select="0"/>
|
119
|
+
<xsl:apply-templates select="(d:bookinfo/d:title|d:info/d:title|d:title)[1]"
|
120
|
+
mode="title.markup">
|
121
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
122
|
+
</xsl:apply-templates>
|
123
|
+
</xsl:template>
|
124
|
+
|
125
|
+
<xsl:template match="d:part" mode="title.markup">
|
126
|
+
<xsl:param name="allow-anchors" select="0"/>
|
127
|
+
<xsl:apply-templates select="(d:partinfo/d:title|d:info/d:title|d:docinfo/d:title|d:title)[1]"
|
128
|
+
mode="title.markup">
|
129
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
130
|
+
</xsl:apply-templates>
|
131
|
+
</xsl:template>
|
132
|
+
|
133
|
+
<xsl:template match="d:preface|d:chapter|d:appendix" mode="title.markup">
|
134
|
+
<xsl:param name="allow-anchors" select="0"/>
|
135
|
+
|
136
|
+
<!--
|
137
|
+
<xsl:message>
|
138
|
+
<xsl:value-of select="local-name(.)"/>
|
139
|
+
<xsl:text> </xsl:text>
|
140
|
+
<xsl:value-of select="$allow-anchors"/>
|
141
|
+
</xsl:message>
|
142
|
+
-->
|
143
|
+
|
144
|
+
<xsl:variable name="title" select="(d:docinfo/d:title
|
145
|
+
|d:info/d:title
|
146
|
+
|d:prefaceinfo/d:title
|
147
|
+
|d:chapterinfo/d:title
|
148
|
+
|d:appendixinfo/d:title
|
149
|
+
|d:title)[1]"/>
|
150
|
+
<xsl:apply-templates select="$title" mode="title.markup">
|
151
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
152
|
+
</xsl:apply-templates>
|
153
|
+
</xsl:template>
|
154
|
+
|
155
|
+
<xsl:template match="d:dedication" mode="title.markup">
|
156
|
+
<xsl:param name="allow-anchors" select="0"/>
|
157
|
+
<xsl:choose>
|
158
|
+
<xsl:when test="d:title|d:info/d:title">
|
159
|
+
<xsl:apply-templates select="(d:title|d:info/d:title)[1]" mode="title.markup">
|
160
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
161
|
+
</xsl:apply-templates>
|
162
|
+
</xsl:when>
|
163
|
+
<xsl:otherwise>
|
164
|
+
<xsl:call-template name="gentext">
|
165
|
+
<xsl:with-param name="key" select="'Dedication'"/>
|
166
|
+
</xsl:call-template>
|
167
|
+
</xsl:otherwise>
|
168
|
+
</xsl:choose>
|
169
|
+
</xsl:template>
|
170
|
+
|
171
|
+
<xsl:template match="d:acknowledgements" mode="title.markup">
|
172
|
+
<xsl:param name="allow-anchors" select="0"/>
|
173
|
+
<xsl:choose>
|
174
|
+
<xsl:when test="d:title|d:info/d:title">
|
175
|
+
<xsl:apply-templates select="(d:title|d:info/d:title)[1]" mode="title.markup">
|
176
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
177
|
+
</xsl:apply-templates>
|
178
|
+
</xsl:when>
|
179
|
+
<xsl:otherwise>
|
180
|
+
<xsl:call-template name="gentext">
|
181
|
+
<xsl:with-param name="key" select="'Acknowledgements'"/>
|
182
|
+
</xsl:call-template>
|
183
|
+
</xsl:otherwise>
|
184
|
+
</xsl:choose>
|
185
|
+
</xsl:template>
|
186
|
+
|
187
|
+
<xsl:template match="d:colophon" mode="title.markup">
|
188
|
+
<xsl:param name="allow-anchors" select="0"/>
|
189
|
+
<xsl:choose>
|
190
|
+
<xsl:when test="d:title|d:info/d:title">
|
191
|
+
<xsl:apply-templates select="(d:title|d:info/d:title)[1]" mode="title.markup">
|
192
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
193
|
+
</xsl:apply-templates>
|
194
|
+
</xsl:when>
|
195
|
+
<xsl:otherwise>
|
196
|
+
<xsl:call-template name="gentext">
|
197
|
+
<xsl:with-param name="key" select="'Colophon'"/>
|
198
|
+
</xsl:call-template>
|
199
|
+
</xsl:otherwise>
|
200
|
+
</xsl:choose>
|
201
|
+
</xsl:template>
|
202
|
+
|
203
|
+
<xsl:template match="d:article" mode="title.markup">
|
204
|
+
<xsl:param name="allow-anchors" select="0"/>
|
205
|
+
<xsl:variable name="title" select="(d:artheader/d:title
|
206
|
+
|d:articleinfo/d:title
|
207
|
+
|d:info/d:title
|
208
|
+
|d:title)[1]"/>
|
209
|
+
|
210
|
+
<xsl:apply-templates select="$title" mode="title.markup">
|
211
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
212
|
+
</xsl:apply-templates>
|
213
|
+
</xsl:template>
|
214
|
+
|
215
|
+
<xsl:template match="d:reference" mode="title.markup">
|
216
|
+
<xsl:param name="allow-anchors" select="0"/>
|
217
|
+
<xsl:apply-templates select="(d:referenceinfo/d:title|d:docinfo/d:title|d:info/d:title|d:title)[1]"
|
218
|
+
mode="title.markup">
|
219
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
220
|
+
</xsl:apply-templates>
|
221
|
+
</xsl:template>
|
222
|
+
|
223
|
+
<xsl:template match="d:refentry" mode="title.markup">
|
224
|
+
<xsl:param name="allow-anchors" select="0"/>
|
225
|
+
<xsl:variable name="refmeta" select=".//d:refmeta"/>
|
226
|
+
<xsl:variable name="refentrytitle" select="$refmeta//d:refentrytitle"/>
|
227
|
+
<xsl:variable name="refnamediv" select=".//d:refnamediv"/>
|
228
|
+
<xsl:variable name="refname" select="$refnamediv//d:refname"/>
|
229
|
+
<xsl:variable name="refdesc" select="$refnamediv//d:refdescriptor"/>
|
230
|
+
|
231
|
+
<xsl:variable name="title">
|
232
|
+
<xsl:choose>
|
233
|
+
<xsl:when test="$refentrytitle">
|
234
|
+
<xsl:apply-templates select="$refentrytitle[1]" mode="title.markup"/>
|
235
|
+
</xsl:when>
|
236
|
+
<xsl:when test="$refdesc">
|
237
|
+
<xsl:apply-templates select="$refdesc" mode="title.markup"/>
|
238
|
+
</xsl:when>
|
239
|
+
<xsl:when test="$refname">
|
240
|
+
<xsl:apply-templates select="$refname[1]" mode="title.markup"/>
|
241
|
+
</xsl:when>
|
242
|
+
<xsl:otherwise>REFENTRY WITHOUT TITLE???</xsl:otherwise>
|
243
|
+
</xsl:choose>
|
244
|
+
</xsl:variable>
|
245
|
+
|
246
|
+
<xsl:copy-of select="$title"/>
|
247
|
+
</xsl:template>
|
248
|
+
|
249
|
+
<xsl:template match="d:refentrytitle|d:refname|d:refdescriptor" mode="title.markup">
|
250
|
+
<xsl:param name="allow-anchors" select="0"/>
|
251
|
+
<xsl:choose>
|
252
|
+
<xsl:when test="$allow-anchors != 0">
|
253
|
+
<xsl:apply-templates/>
|
254
|
+
</xsl:when>
|
255
|
+
<xsl:otherwise>
|
256
|
+
<xsl:apply-templates mode="no.anchor.mode"/>
|
257
|
+
</xsl:otherwise>
|
258
|
+
</xsl:choose>
|
259
|
+
</xsl:template>
|
260
|
+
|
261
|
+
<xsl:template match="d:section
|
262
|
+
|d:sect1|d:sect2|d:sect3|d:sect4|d:sect5
|
263
|
+
|d:refsect1|d:refsect2|d:refsect3|d:refsection
|
264
|
+
|d:topic
|
265
|
+
|d:simplesect"
|
266
|
+
mode="title.markup">
|
267
|
+
<xsl:param name="allow-anchors" select="0"/>
|
268
|
+
<xsl:variable name="title" select="(d:info/d:title
|
269
|
+
|d:sectioninfo/d:title
|
270
|
+
|d:sect1info/d:title
|
271
|
+
|d:sect2info/d:title
|
272
|
+
|d:sect3info/d:title
|
273
|
+
|d:sect4info/d:title
|
274
|
+
|d:sect5info/d:title
|
275
|
+
|d:refsect1info/d:title
|
276
|
+
|d:refsect2info/d:title
|
277
|
+
|d:refsect3info/d:title
|
278
|
+
|d:refsectioninfo/d:title
|
279
|
+
|d:title)[1]"/>
|
280
|
+
|
281
|
+
<xsl:apply-templates select="$title" mode="title.markup">
|
282
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
283
|
+
</xsl:apply-templates>
|
284
|
+
</xsl:template>
|
285
|
+
|
286
|
+
<xsl:template match="d:bridgehead" mode="title.markup">
|
287
|
+
<xsl:apply-templates/>
|
288
|
+
</xsl:template>
|
289
|
+
|
290
|
+
<xsl:template match="d:refsynopsisdiv" mode="title.markup">
|
291
|
+
<xsl:param name="allow-anchors" select="0"/>
|
292
|
+
<xsl:choose>
|
293
|
+
<xsl:when test="d:title|d:info/d:title">
|
294
|
+
<xsl:apply-templates select="(d:title|d:info/d:title)[1]" mode="title.markup">
|
295
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
296
|
+
</xsl:apply-templates>
|
297
|
+
</xsl:when>
|
298
|
+
<xsl:otherwise>
|
299
|
+
<xsl:call-template name="gentext">
|
300
|
+
<xsl:with-param name="key" select="'RefSynopsisDiv'"/>
|
301
|
+
</xsl:call-template>
|
302
|
+
</xsl:otherwise>
|
303
|
+
</xsl:choose>
|
304
|
+
</xsl:template>
|
305
|
+
|
306
|
+
<xsl:template match="d:bibliography" mode="title.markup">
|
307
|
+
<xsl:param name="allow-anchors" select="0"/>
|
308
|
+
<xsl:variable name="title" select="(d:bibliographyinfo/d:title|d:info/d:title|d:title)[1]"/>
|
309
|
+
<xsl:choose>
|
310
|
+
<xsl:when test="$title">
|
311
|
+
<xsl:apply-templates select="$title" mode="title.markup">
|
312
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
313
|
+
</xsl:apply-templates>
|
314
|
+
</xsl:when>
|
315
|
+
<xsl:otherwise>
|
316
|
+
<xsl:call-template name="gentext">
|
317
|
+
<xsl:with-param name="key" select="'Bibliography'"/>
|
318
|
+
</xsl:call-template>
|
319
|
+
</xsl:otherwise>
|
320
|
+
</xsl:choose>
|
321
|
+
</xsl:template>
|
322
|
+
|
323
|
+
<xsl:template match="d:glossary" mode="title.markup">
|
324
|
+
<xsl:param name="allow-anchors" select="0"/>
|
325
|
+
<xsl:variable name="title" select="(d:glossaryinfo/d:title|d:info/d:title|d:title)[1]"/>
|
326
|
+
<xsl:choose>
|
327
|
+
<xsl:when test="$title">
|
328
|
+
<xsl:apply-templates select="$title" mode="title.markup">
|
329
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
330
|
+
</xsl:apply-templates>
|
331
|
+
</xsl:when>
|
332
|
+
<xsl:otherwise>
|
333
|
+
<xsl:call-template name="gentext.element.name">
|
334
|
+
<xsl:with-param name="element.name" select="local-name(.)"/>
|
335
|
+
</xsl:call-template>
|
336
|
+
</xsl:otherwise>
|
337
|
+
</xsl:choose>
|
338
|
+
</xsl:template>
|
339
|
+
|
340
|
+
<xsl:template match="d:glossdiv" mode="title.markup">
|
341
|
+
<xsl:param name="allow-anchors" select="0"/>
|
342
|
+
<xsl:variable name="title" select="(d:info/d:title|d:title)[1]"/>
|
343
|
+
<xsl:choose>
|
344
|
+
<xsl:when test="$title">
|
345
|
+
<xsl:apply-templates select="$title" mode="title.markup">
|
346
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
347
|
+
</xsl:apply-templates>
|
348
|
+
</xsl:when>
|
349
|
+
<xsl:otherwise>
|
350
|
+
<xsl:message>ERROR: glossdiv missing its required title</xsl:message>
|
351
|
+
</xsl:otherwise>
|
352
|
+
</xsl:choose>
|
353
|
+
</xsl:template>
|
354
|
+
|
355
|
+
<xsl:template match="d:glossentry" mode="title.markup">
|
356
|
+
<xsl:param name="allow-anchors" select="0"/>
|
357
|
+
<xsl:apply-templates select="d:glossterm" mode="title.markup">
|
358
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
359
|
+
</xsl:apply-templates>
|
360
|
+
</xsl:template>
|
361
|
+
|
362
|
+
<xsl:template match="d:glossterm|d:firstterm" mode="title.markup">
|
363
|
+
<xsl:param name="allow-anchors" select="0"/>
|
364
|
+
|
365
|
+
<xsl:choose>
|
366
|
+
<xsl:when test="$allow-anchors != 0">
|
367
|
+
<xsl:apply-templates/>
|
368
|
+
</xsl:when>
|
369
|
+
<xsl:otherwise>
|
370
|
+
<xsl:apply-templates mode="no.anchor.mode"/>
|
371
|
+
</xsl:otherwise>
|
372
|
+
</xsl:choose>
|
373
|
+
</xsl:template>
|
374
|
+
|
375
|
+
<xsl:template match="d:index" mode="title.markup">
|
376
|
+
<xsl:param name="allow-anchors" select="0"/>
|
377
|
+
<xsl:variable name="title" select="(d:indexinfo/d:title|d:info/d:title|d:title)[1]"/>
|
378
|
+
<xsl:choose>
|
379
|
+
<xsl:when test="$title">
|
380
|
+
<xsl:apply-templates select="$title" mode="title.markup">
|
381
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
382
|
+
</xsl:apply-templates>
|
383
|
+
</xsl:when>
|
384
|
+
<xsl:otherwise>
|
385
|
+
<xsl:call-template name="gentext">
|
386
|
+
<xsl:with-param name="key" select="'Index'"/>
|
387
|
+
</xsl:call-template>
|
388
|
+
</xsl:otherwise>
|
389
|
+
</xsl:choose>
|
390
|
+
</xsl:template>
|
391
|
+
|
392
|
+
<xsl:template match="d:setindex" mode="title.markup">
|
393
|
+
<xsl:param name="allow-anchors" select="0"/>
|
394
|
+
<xsl:variable name="title" select="(d:setindexinfo/d:title|d:info/d:title|d:title)[1]"/>
|
395
|
+
<xsl:choose>
|
396
|
+
<xsl:when test="$title">
|
397
|
+
<xsl:apply-templates select="$title" mode="title.markup">
|
398
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
399
|
+
</xsl:apply-templates>
|
400
|
+
</xsl:when>
|
401
|
+
<xsl:otherwise>
|
402
|
+
<xsl:call-template name="gentext">
|
403
|
+
<xsl:with-param name="key" select="'SetIndex'"/>
|
404
|
+
</xsl:call-template>
|
405
|
+
</xsl:otherwise>
|
406
|
+
</xsl:choose>
|
407
|
+
</xsl:template>
|
408
|
+
|
409
|
+
<xsl:template match="d:figure|d:example|d:equation" mode="title.markup">
|
410
|
+
<xsl:param name="allow-anchors" select="0"/>
|
411
|
+
<xsl:apply-templates select="(d:title|d:info/d:title)[1]" mode="title.markup">
|
412
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
413
|
+
</xsl:apply-templates>
|
414
|
+
</xsl:template>
|
415
|
+
|
416
|
+
<xsl:template match="d:table" mode="title.markup">
|
417
|
+
<xsl:param name="allow-anchors" select="0"/>
|
418
|
+
<xsl:apply-templates select="(d:title|d:info/d:title|d:caption)[1]" mode="title.markup">
|
419
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
420
|
+
</xsl:apply-templates>
|
421
|
+
</xsl:template>
|
422
|
+
|
423
|
+
<xsl:template match="d:procedure" mode="title.markup">
|
424
|
+
<xsl:param name="allow-anchors" select="0"/>
|
425
|
+
<xsl:apply-templates select="(d:title|d:info/d:title)[1]" mode="title.markup">
|
426
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
427
|
+
</xsl:apply-templates>
|
428
|
+
</xsl:template>
|
429
|
+
|
430
|
+
<xsl:template match="d:task" mode="title.markup">
|
431
|
+
<xsl:param name="allow-anchors" select="0"/>
|
432
|
+
<xsl:apply-templates select="(d:title|d:info/d:title)[1]" mode="title.markup">
|
433
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
434
|
+
</xsl:apply-templates>
|
435
|
+
</xsl:template>
|
436
|
+
|
437
|
+
<xsl:template match="d:sidebar" mode="title.markup">
|
438
|
+
<xsl:param name="allow-anchors" select="0"/>
|
439
|
+
<xsl:apply-templates select="(d:info/d:title|d:sidebarinfo/d:title|d:title)[1]"
|
440
|
+
mode="title.markup">
|
441
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
442
|
+
</xsl:apply-templates>
|
443
|
+
</xsl:template>
|
444
|
+
|
445
|
+
<xsl:template match="d:abstract" mode="title.markup">
|
446
|
+
<xsl:param name="allow-anchors" select="0"/>
|
447
|
+
<xsl:choose>
|
448
|
+
<xsl:when test="d:title|d:info/d:title">
|
449
|
+
<xsl:apply-templates select="(d:title|d:info/d:title)[1]" mode="title.markup">
|
450
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
451
|
+
</xsl:apply-templates>
|
452
|
+
</xsl:when>
|
453
|
+
<xsl:otherwise>
|
454
|
+
<xsl:call-template name="gentext">
|
455
|
+
<xsl:with-param name="key" select="'Abstract'"/>
|
456
|
+
</xsl:call-template>
|
457
|
+
</xsl:otherwise>
|
458
|
+
</xsl:choose>
|
459
|
+
</xsl:template>
|
460
|
+
|
461
|
+
<xsl:template match="d:caution|d:tip|d:warning|d:important|d:note" mode="title.markup">
|
462
|
+
<xsl:param name="allow-anchors" select="0"/>
|
463
|
+
<xsl:variable name="title" select="(d:title|d:info/d:title)[1]"/>
|
464
|
+
<xsl:choose>
|
465
|
+
<xsl:when test="$title">
|
466
|
+
<xsl:apply-templates select="$title" mode="title.markup">
|
467
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
468
|
+
</xsl:apply-templates>
|
469
|
+
</xsl:when>
|
470
|
+
<xsl:otherwise>
|
471
|
+
<xsl:call-template name="gentext">
|
472
|
+
<xsl:with-param name="key">
|
473
|
+
<xsl:choose>
|
474
|
+
<xsl:when test="local-name(.)='note'">Note</xsl:when>
|
475
|
+
<xsl:when test="local-name(.)='important'">Important</xsl:when>
|
476
|
+
<xsl:when test="local-name(.)='caution'">Caution</xsl:when>
|
477
|
+
<xsl:when test="local-name(.)='warning'">Warning</xsl:when>
|
478
|
+
<xsl:when test="local-name(.)='tip'">Tip</xsl:when>
|
479
|
+
</xsl:choose>
|
480
|
+
</xsl:with-param>
|
481
|
+
</xsl:call-template>
|
482
|
+
</xsl:otherwise>
|
483
|
+
</xsl:choose>
|
484
|
+
</xsl:template>
|
485
|
+
|
486
|
+
<xsl:template match="d:question" mode="title.markup">
|
487
|
+
<!-- questions don't have titles -->
|
488
|
+
<xsl:text>Question</xsl:text>
|
489
|
+
</xsl:template>
|
490
|
+
|
491
|
+
<xsl:template match="d:answer" mode="title.markup">
|
492
|
+
<!-- answers don't have titles -->
|
493
|
+
<xsl:text>Answer</xsl:text>
|
494
|
+
</xsl:template>
|
495
|
+
|
496
|
+
<xsl:template match="d:qandaentry" mode="title.markup">
|
497
|
+
<!-- qandaentrys are represented by the first question in them -->
|
498
|
+
<xsl:text>Question</xsl:text>
|
499
|
+
</xsl:template>
|
500
|
+
|
501
|
+
<xsl:template match="d:qandaset" mode="title.markup">
|
502
|
+
<xsl:param name="allow-anchors" select="0"/>
|
503
|
+
<xsl:variable name="title" select="(d:info/d:title|
|
504
|
+
d:blockinfo/d:title|
|
505
|
+
d:title)[1]"/>
|
506
|
+
<xsl:choose>
|
507
|
+
<xsl:when test="$title">
|
508
|
+
<xsl:apply-templates select="$title" mode="title.markup">
|
509
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
510
|
+
</xsl:apply-templates>
|
511
|
+
</xsl:when>
|
512
|
+
<xsl:otherwise>
|
513
|
+
<xsl:call-template name="gentext">
|
514
|
+
<xsl:with-param name="key" select="'QandASet'"/>
|
515
|
+
</xsl:call-template>
|
516
|
+
</xsl:otherwise>
|
517
|
+
</xsl:choose>
|
518
|
+
</xsl:template>
|
519
|
+
|
520
|
+
<xsl:template match="d:legalnotice" mode="title.markup">
|
521
|
+
<xsl:param name="allow-anchors" select="0"/>
|
522
|
+
<xsl:choose>
|
523
|
+
<xsl:when test="d:title|d:info/d:title">
|
524
|
+
<xsl:apply-templates select="(d:title|d:info/d:title)[1]" mode="title.markup">
|
525
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
526
|
+
</xsl:apply-templates>
|
527
|
+
</xsl:when>
|
528
|
+
<xsl:otherwise>
|
529
|
+
<xsl:call-template name="gentext">
|
530
|
+
<xsl:with-param name="key" select="'LegalNotice'"/>
|
531
|
+
</xsl:call-template>
|
532
|
+
</xsl:otherwise>
|
533
|
+
</xsl:choose>
|
534
|
+
</xsl:template>
|
535
|
+
|
536
|
+
<!-- ============================================================ -->
|
537
|
+
|
538
|
+
<!-- titleabbrev is always processed in a mode -->
|
539
|
+
<xsl:template match="d:titleabbrev"/>
|
540
|
+
|
541
|
+
<xsl:template match="*" mode="titleabbrev.markup">
|
542
|
+
<xsl:param name="allow-anchors" select="0"/>
|
543
|
+
<xsl:param name="verbose" select="1"/>
|
544
|
+
|
545
|
+
<xsl:choose>
|
546
|
+
<xsl:when test="d:titleabbrev">
|
547
|
+
<xsl:apply-templates select="d:titleabbrev[1]" mode="title.markup">
|
548
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
549
|
+
</xsl:apply-templates>
|
550
|
+
</xsl:when>
|
551
|
+
<xsl:when test="d:info/d:titleabbrev">
|
552
|
+
<xsl:apply-templates select="d:info/d:titleabbrev[1]" mode="title.markup">
|
553
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
554
|
+
</xsl:apply-templates>
|
555
|
+
</xsl:when>
|
556
|
+
<xsl:otherwise>
|
557
|
+
<xsl:apply-templates select="." mode="title.markup">
|
558
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
559
|
+
<xsl:with-param name="verbose" select="$verbose"/>
|
560
|
+
</xsl:apply-templates>
|
561
|
+
</xsl:otherwise>
|
562
|
+
</xsl:choose>
|
563
|
+
</xsl:template>
|
564
|
+
|
565
|
+
<xsl:template match="d:book|d:part|d:set|d:preface|d:chapter|d:appendix" mode="titleabbrev.markup">
|
566
|
+
<xsl:param name="allow-anchors" select="0"/>
|
567
|
+
<xsl:param name="verbose" select="1"/>
|
568
|
+
|
569
|
+
<xsl:variable name="titleabbrev" select="(d:docinfo/d:titleabbrev
|
570
|
+
|d:bookinfo/d:titleabbrev
|
571
|
+
|d:info/d:titleabbrev
|
572
|
+
|d:prefaceinfo/d:titleabbrev
|
573
|
+
|d:setinfo/d:titleabbrev
|
574
|
+
|d:partinfo/d:titleabbrev
|
575
|
+
|d:chapterinfo/d:titleabbrev
|
576
|
+
|d:appendixinfo/d:titleabbrev
|
577
|
+
|d:titleabbrev)[1]"/>
|
578
|
+
|
579
|
+
<xsl:choose>
|
580
|
+
<xsl:when test="$titleabbrev">
|
581
|
+
<xsl:apply-templates select="$titleabbrev" mode="title.markup">
|
582
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
583
|
+
</xsl:apply-templates>
|
584
|
+
</xsl:when>
|
585
|
+
<xsl:otherwise>
|
586
|
+
<xsl:apply-templates select="." mode="title.markup">
|
587
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
588
|
+
<xsl:with-param name="verbose" select="$verbose"/>
|
589
|
+
</xsl:apply-templates>
|
590
|
+
</xsl:otherwise>
|
591
|
+
</xsl:choose>
|
592
|
+
</xsl:template>
|
593
|
+
|
594
|
+
<xsl:template match="d:article" mode="titleabbrev.markup">
|
595
|
+
<xsl:param name="allow-anchors" select="0"/>
|
596
|
+
<xsl:param name="verbose" select="1"/>
|
597
|
+
|
598
|
+
<xsl:variable name="titleabbrev" select="(d:artheader/d:titleabbrev
|
599
|
+
|d:articleinfo/d:titleabbrev
|
600
|
+
|d:info/d:titleabbrev
|
601
|
+
|d:titleabbrev)[1]"/>
|
602
|
+
|
603
|
+
<xsl:choose>
|
604
|
+
<xsl:when test="$titleabbrev">
|
605
|
+
<xsl:apply-templates select="$titleabbrev" mode="title.markup">
|
606
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
607
|
+
</xsl:apply-templates>
|
608
|
+
</xsl:when>
|
609
|
+
<xsl:otherwise>
|
610
|
+
<xsl:apply-templates select="." mode="title.markup">
|
611
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
612
|
+
<xsl:with-param name="verbose" select="$verbose"/>
|
613
|
+
</xsl:apply-templates>
|
614
|
+
</xsl:otherwise>
|
615
|
+
</xsl:choose>
|
616
|
+
</xsl:template>
|
617
|
+
|
618
|
+
<xsl:template match="d:section
|
619
|
+
|d:sect1|d:sect2|d:sect3|d:sect4|d:sect5
|
620
|
+
|d:refsect1|d:refsect2|d:refsect3
|
621
|
+
|d:topic
|
622
|
+
|d:simplesect"
|
623
|
+
mode="titleabbrev.markup">
|
624
|
+
<xsl:param name="allow-anchors" select="0"/>
|
625
|
+
<xsl:param name="verbose" select="1"/>
|
626
|
+
|
627
|
+
<xsl:variable name="titleabbrev" select="(d:info/d:titleabbrev
|
628
|
+
|d:sectioninfo/d:titleabbrev
|
629
|
+
|d:sect1info/d:titleabbrev
|
630
|
+
|d:sect2info/d:titleabbrev
|
631
|
+
|d:sect3info/d:titleabbrev
|
632
|
+
|d:sect4info/d:titleabbrev
|
633
|
+
|d:sect5info/d:titleabbrev
|
634
|
+
|d:refsect1info/d:titleabbrev
|
635
|
+
|d:refsect2info/d:titleabbrev
|
636
|
+
|d:refsect3info/d:titleabbrev
|
637
|
+
|d:titleabbrev)[1]"/>
|
638
|
+
|
639
|
+
<xsl:choose>
|
640
|
+
<xsl:when test="$titleabbrev">
|
641
|
+
<xsl:apply-templates select="$titleabbrev" mode="title.markup">
|
642
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
643
|
+
</xsl:apply-templates>
|
644
|
+
</xsl:when>
|
645
|
+
<xsl:otherwise>
|
646
|
+
<xsl:apply-templates select="." mode="title.markup">
|
647
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
648
|
+
<xsl:with-param name="verbose" select="$verbose"/>
|
649
|
+
</xsl:apply-templates>
|
650
|
+
</xsl:otherwise>
|
651
|
+
</xsl:choose>
|
652
|
+
</xsl:template>
|
653
|
+
|
654
|
+
<xsl:template match="d:titleabbrev" mode="title.markup">
|
655
|
+
<xsl:param name="allow-anchors" select="0"/>
|
656
|
+
|
657
|
+
<xsl:choose>
|
658
|
+
<xsl:when test="$allow-anchors != 0">
|
659
|
+
<xsl:apply-templates/>
|
660
|
+
</xsl:when>
|
661
|
+
<xsl:otherwise>
|
662
|
+
<xsl:apply-templates mode="no.anchor.mode"/>
|
663
|
+
</xsl:otherwise>
|
664
|
+
</xsl:choose>
|
665
|
+
</xsl:template>
|
666
|
+
|
667
|
+
<!-- ============================================================ -->
|
668
|
+
|
669
|
+
<xsl:template match="*" mode="no.anchor.mode">
|
670
|
+
<!-- Switch to normal mode if no links -->
|
671
|
+
<xsl:choose>
|
672
|
+
<xsl:when test="descendant-or-self::d:footnote or
|
673
|
+
descendant-or-self::d:anchor or
|
674
|
+
descendant-or-self::d:ulink or
|
675
|
+
descendant-or-self::d:link or
|
676
|
+
descendant-or-self::d:olink or
|
677
|
+
descendant-or-self::d:xref or
|
678
|
+
descendant-or-self::d:indexterm or
|
679
|
+
(ancestor::d:title and (@id or @xml:id))">
|
680
|
+
|
681
|
+
<xsl:apply-templates mode="no.anchor.mode"/>
|
682
|
+
</xsl:when>
|
683
|
+
<xsl:otherwise>
|
684
|
+
<xsl:apply-templates select="."/>
|
685
|
+
</xsl:otherwise>
|
686
|
+
</xsl:choose>
|
687
|
+
</xsl:template>
|
688
|
+
|
689
|
+
<xsl:template match="d:footnote" mode="no.anchor.mode">
|
690
|
+
<!-- nop, suppressed -->
|
691
|
+
</xsl:template>
|
692
|
+
|
693
|
+
<xsl:template match="d:anchor" mode="no.anchor.mode">
|
694
|
+
<!-- nop, suppressed -->
|
695
|
+
</xsl:template>
|
696
|
+
|
697
|
+
<xsl:template match="d:ulink" mode="no.anchor.mode">
|
698
|
+
<xsl:param name="url" select="@url"/>
|
699
|
+
<xsl:choose>
|
700
|
+
<xsl:when test="count(child::node())=0">
|
701
|
+
<xsl:value-of select="$url"/>
|
702
|
+
</xsl:when>
|
703
|
+
<xsl:otherwise>
|
704
|
+
<xsl:apply-templates/>
|
705
|
+
</xsl:otherwise>
|
706
|
+
</xsl:choose>
|
707
|
+
</xsl:template>
|
708
|
+
|
709
|
+
<xsl:template match="d:link" mode="no.anchor.mode">
|
710
|
+
<xsl:choose>
|
711
|
+
<xsl:when test="count(child::node()) > 0">
|
712
|
+
<!-- If it has content, use it -->
|
713
|
+
<xsl:apply-templates/>
|
714
|
+
</xsl:when>
|
715
|
+
<!-- look for an endterm -->
|
716
|
+
<xsl:when test="@endterm">
|
717
|
+
<xsl:variable name="etargets" select="key('id',@endterm)"/>
|
718
|
+
<xsl:variable name="etarget" select="$etargets[1]"/>
|
719
|
+
<xsl:choose>
|
720
|
+
<xsl:when test="count($etarget) = 0">
|
721
|
+
<xsl:message>
|
722
|
+
<xsl:value-of select="count($etargets)"/>
|
723
|
+
<xsl:text>Endterm points to nonexistent ID: </xsl:text>
|
724
|
+
<xsl:value-of select="@endterm"/>
|
725
|
+
</xsl:message>
|
726
|
+
<xsl:text>???</xsl:text>
|
727
|
+
</xsl:when>
|
728
|
+
<xsl:otherwise>
|
729
|
+
<xsl:apply-templates select="$etarget" mode="endterm"/>
|
730
|
+
</xsl:otherwise>
|
731
|
+
</xsl:choose>
|
732
|
+
</xsl:when>
|
733
|
+
<xsl:otherwise>
|
734
|
+
<xsl:apply-templates/>
|
735
|
+
</xsl:otherwise>
|
736
|
+
</xsl:choose>
|
737
|
+
</xsl:template>
|
738
|
+
|
739
|
+
<xsl:template match="d:olink" mode="no.anchor.mode">
|
740
|
+
<xsl:apply-templates/>
|
741
|
+
</xsl:template>
|
742
|
+
|
743
|
+
<xsl:template match="d:indexterm" mode="no.anchor.mode">
|
744
|
+
<!-- nop, suppressed -->
|
745
|
+
</xsl:template>
|
746
|
+
|
747
|
+
<xsl:template match="d:xref" mode="no.anchor.mode">
|
748
|
+
<xsl:variable name="referrer" select="."/>
|
749
|
+
<xsl:variable name="targets" select="key('id',@linkend)|key('id',substring-after(@xlink:href,'#'))"/>
|
750
|
+
<xsl:variable name="target" select="$targets[1]"/>
|
751
|
+
<xsl:variable name="refelem" select="local-name($target)"/>
|
752
|
+
<xsl:variable name="xrefstyle">
|
753
|
+
<xsl:apply-templates select="." mode="xrefstyle">
|
754
|
+
<xsl:with-param name="target" select="$target"/>
|
755
|
+
<xsl:with-param name="referrer" select="$referrer"/>
|
756
|
+
</xsl:apply-templates>
|
757
|
+
</xsl:variable>
|
758
|
+
|
759
|
+
<xsl:call-template name="check.id.unique">
|
760
|
+
<xsl:with-param name="linkend" select="@linkend"/>
|
761
|
+
</xsl:call-template>
|
762
|
+
|
763
|
+
<xsl:choose>
|
764
|
+
<xsl:when test="count($target) = 0">
|
765
|
+
<xsl:message>
|
766
|
+
<xsl:text>XRef to nonexistent id: </xsl:text>
|
767
|
+
<xsl:value-of select="@linkend"/>
|
768
|
+
<xsl:value-of select="@xlink:href"/>
|
769
|
+
</xsl:message>
|
770
|
+
<xsl:text>???</xsl:text>
|
771
|
+
</xsl:when>
|
772
|
+
|
773
|
+
<xsl:when test="@endterm">
|
774
|
+
<xsl:variable name="etargets" select="key('id',@endterm)"/>
|
775
|
+
<xsl:variable name="etarget" select="$etargets[1]"/>
|
776
|
+
<xsl:choose>
|
777
|
+
<xsl:when test="count($etarget) = 0">
|
778
|
+
<xsl:message>
|
779
|
+
<xsl:value-of select="count($etargets)"/>
|
780
|
+
<xsl:text>Endterm points to nonexistent ID: </xsl:text>
|
781
|
+
<xsl:value-of select="@endterm"/>
|
782
|
+
</xsl:message>
|
783
|
+
<xsl:text>???</xsl:text>
|
784
|
+
</xsl:when>
|
785
|
+
<xsl:otherwise>
|
786
|
+
<xsl:apply-templates select="$etarget" mode="endterm"/>
|
787
|
+
</xsl:otherwise>
|
788
|
+
</xsl:choose>
|
789
|
+
</xsl:when>
|
790
|
+
|
791
|
+
<xsl:when test="$target/@xreflabel">
|
792
|
+
<xsl:call-template name="xref.xreflabel">
|
793
|
+
<xsl:with-param name="target" select="$target"/>
|
794
|
+
</xsl:call-template>
|
795
|
+
</xsl:when>
|
796
|
+
|
797
|
+
<xsl:otherwise>
|
798
|
+
|
799
|
+
<xsl:choose>
|
800
|
+
<!-- Watch out for the case when there is a xref or link inside
|
801
|
+
a title. See bugs #1811721 and #1838136. -->
|
802
|
+
<xsl:when test="not(ancestor::*[@id = $target/@id] or ancestor::*[@xml:id = $target/@xml:id])">
|
803
|
+
|
804
|
+
<xsl:apply-templates select="$target" mode="xref-to-prefix">
|
805
|
+
<xsl:with-param name="referrer" select="."/>
|
806
|
+
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
|
807
|
+
</xsl:apply-templates>
|
808
|
+
|
809
|
+
<xsl:apply-templates select="$target" mode="xref-to">
|
810
|
+
<xsl:with-param name="referrer" select="."/>
|
811
|
+
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
|
812
|
+
</xsl:apply-templates>
|
813
|
+
|
814
|
+
<xsl:apply-templates select="$target" mode="xref-to-suffix">
|
815
|
+
<xsl:with-param name="referrer" select="."/>
|
816
|
+
<xsl:with-param name="xrefstyle" select="$xrefstyle"/>
|
817
|
+
</xsl:apply-templates>
|
818
|
+
</xsl:when>
|
819
|
+
|
820
|
+
<xsl:otherwise>
|
821
|
+
<xsl:apply-templates/>
|
822
|
+
</xsl:otherwise>
|
823
|
+
|
824
|
+
</xsl:choose>
|
825
|
+
</xsl:otherwise>
|
826
|
+
</xsl:choose>
|
827
|
+
|
828
|
+
</xsl:template>
|
829
|
+
|
830
|
+
<!-- ============================================================ -->
|
831
|
+
|
832
|
+
<xsl:template mode="title.markup" match="d:toc">
|
833
|
+
<xsl:param name="allow-anchors" select="0"/>
|
834
|
+
<xsl:param name="verbose" select="1"/>
|
835
|
+
<xsl:choose>
|
836
|
+
<xsl:when test="d:title|d:info/d:title">
|
837
|
+
<xsl:apply-templates select="(d:title|d:info/d:title)[1]" mode="title.markup">
|
838
|
+
<xsl:with-param name="allow-anchors" select="$allow-anchors"/>
|
839
|
+
</xsl:apply-templates>
|
840
|
+
</xsl:when>
|
841
|
+
<xsl:otherwise>
|
842
|
+
<xsl:call-template name="gentext">
|
843
|
+
<xsl:with-param name="key" select="'TableofContents'"/>
|
844
|
+
</xsl:call-template>
|
845
|
+
</xsl:otherwise>
|
846
|
+
</xsl:choose>
|
847
|
+
</xsl:template>
|
848
|
+
|
849
|
+
</xsl:stylesheet>
|
850
|
+
|