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