source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml-1_1/xref.xsl@ dd2d8eb

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since dd2d8eb was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 44.8 KB
Line 
1<?xml version="1.0" encoding="ASCII"?><!--This file was created automatically by html2xhtml--><!--from the HTML stylesheets.--><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:suwl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.UnwrapLinks" xmlns:exsl="http://exslt.org/common" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="suwl exsl xlink" version="1.0">
2
3<!-- ********************************************************************
4 $Id: xref.xsl 9713 2013-01-22 22:08:30Z bobstayton $
5 ********************************************************************
6
7 This file is part of the XSL DocBook Stylesheet distribution.
8 See ../README or http://docbook.sf.net/release/xsl/current/ for
9 copyright and other information.
10
11 ******************************************************************** -->
12
13<!-- Use internal variable for olink xlink role for consistency -->
14<xsl:variable name="xolink.role">http://docbook.org/xlink/role/olink</xsl:variable>
15
16<!-- ==================================================================== -->
17
18<xsl:template match="anchor">
19 <xsl:choose>
20 <xsl:when test="$generate.id.attributes = 0">
21 <xsl:call-template name="anchor"/>
22 </xsl:when>
23 <xsl:otherwise>
24 <span>
25 <xsl:call-template name="id.attribute"/>
26 </span>
27 </xsl:otherwise>
28 </xsl:choose>
29</xsl:template>
30
31<!-- ==================================================================== -->
32
33<xsl:template match="xref" name="xref">
34 <xsl:param name="xhref" select="@xlink:href"/>
35 <!-- is the @xlink:href a local idref link? -->
36 <xsl:param name="xlink.idref">
37 <xsl:if test="starts-with($xhref,'#') and (not(contains($xhref,'(')) or starts-with($xhref, '#xpointer(id('))">
38 <xsl:call-template name="xpointer.idref">
39 <xsl:with-param name="xpointer" select="$xhref"/>
40 </xsl:call-template>
41 </xsl:if>
42 </xsl:param>
43 <xsl:param name="xlink.targets" select="key('id',$xlink.idref)"/>
44 <xsl:param name="linkend.targets" select="key('id',@linkend)"/>
45 <xsl:param name="target" select="($xlink.targets | $linkend.targets)[1]"/>
46
47 <xsl:variable name="xrefstyle">
48 <xsl:choose>
49 <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0">
50 <xsl:value-of select="@role"/>
51 </xsl:when>
52 <xsl:otherwise>
53 <xsl:value-of select="@xrefstyle"/>
54 </xsl:otherwise>
55 </xsl:choose>
56 </xsl:variable>
57
58 <xsl:call-template name="anchor"/>
59
60 <xsl:variable name="content">
61 <xsl:choose>
62
63 <xsl:when test="@endterm">
64 <xsl:variable name="etargets" select="key('id',@endterm)"/>
65 <xsl:variable name="etarget" select="$etargets[1]"/>
66 <xsl:choose>
67 <xsl:when test="count($etarget) = 0">
68 <xsl:message>
69 <xsl:value-of select="count($etargets)"/>
70 <xsl:text>Endterm points to nonexistent ID: </xsl:text>
71 <xsl:value-of select="@endterm"/>
72 </xsl:message>
73 <xsl:text>???</xsl:text>
74 </xsl:when>
75 <xsl:otherwise>
76 <xsl:apply-templates select="$etarget" mode="endterm"/>
77 </xsl:otherwise>
78 </xsl:choose>
79 </xsl:when>
80
81 <xsl:when test="$target/@xreflabel">
82 <xsl:call-template name="xref.xreflabel">
83 <xsl:with-param name="target" select="$target"/>
84 </xsl:call-template>
85 </xsl:when>
86
87 <xsl:when test="$target">
88 <xsl:if test="not(parent::citation)">
89 <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
90 </xsl:if>
91
92 <xsl:apply-templates select="$target" mode="xref-to">
93 <xsl:with-param name="referrer" select="."/>
94 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
95 </xsl:apply-templates>
96
97 <xsl:if test="not(parent::citation)">
98 <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
99 </xsl:if>
100 </xsl:when>
101
102 <xsl:otherwise>
103 <xsl:message>
104 <xsl:text>ERROR: xref linking to </xsl:text>
105 <xsl:value-of select="@linkend|@xlink:href"/>
106 <xsl:text> has no generated link text.</xsl:text>
107 </xsl:message>
108 <xsl:text>???</xsl:text>
109 </xsl:otherwise>
110 </xsl:choose>
111 </xsl:variable>
112
113 <xsl:call-template name="simple.xlink">
114 <xsl:with-param name="content" select="$content"/>
115 </xsl:call-template>
116
117</xsl:template>
118
119<!-- ==================================================================== -->
120
121<!-- biblioref handled largely like an xref -->
122<!-- To be done: add support for begin, end, and units attributes -->
123<xsl:template match="biblioref">
124 <xsl:variable name="targets" select="key('id',@linkend)"/>
125 <xsl:variable name="target" select="$targets[1]"/>
126 <xsl:variable name="refelem" select="local-name($target)"/>
127
128 <xsl:call-template name="check.id.unique">
129 <xsl:with-param name="linkend" select="@linkend"/>
130 </xsl:call-template>
131
132 <xsl:call-template name="anchor"/>
133
134 <xsl:choose>
135 <xsl:when test="count($target) = 0">
136 <xsl:message>
137 <xsl:text>XRef to nonexistent id: </xsl:text>
138 <xsl:value-of select="@linkend"/>
139 </xsl:message>
140 <xsl:text>???</xsl:text>
141 </xsl:when>
142
143 <xsl:when test="@endterm">
144 <xsl:variable name="href">
145 <xsl:call-template name="href.target">
146 <xsl:with-param name="object" select="$target"/>
147 </xsl:call-template>
148 </xsl:variable>
149
150 <xsl:variable name="etargets" select="key('id',@endterm)"/>
151 <xsl:variable name="etarget" select="$etargets[1]"/>
152 <xsl:choose>
153 <xsl:when test="count($etarget) = 0">
154 <xsl:message>
155 <xsl:value-of select="count($etargets)"/>
156 <xsl:text>Endterm points to nonexistent ID: </xsl:text>
157 <xsl:value-of select="@endterm"/>
158 </xsl:message>
159 <a href="{$href}">
160 <xsl:apply-templates select="." mode="common.html.attributes"/>
161 <xsl:call-template name="id.attribute"/>
162 <xsl:text>???</xsl:text>
163 </a>
164 </xsl:when>
165 <xsl:otherwise>
166 <a href="{$href}">
167 <xsl:apply-templates select="." mode="common.html.attributes"/>
168 <xsl:call-template name="id.attribute"/>
169 <xsl:apply-templates select="$etarget" mode="endterm"/>
170 </a>
171 </xsl:otherwise>
172 </xsl:choose>
173 </xsl:when>
174
175 <xsl:when test="$target/@xreflabel">
176 <a>
177 <xsl:apply-templates select="." mode="common.html.attributes"/>
178 <xsl:attribute name="href">
179 <xsl:call-template name="href.target">
180 <xsl:with-param name="object" select="$target"/>
181 </xsl:call-template>
182 </xsl:attribute>
183 <xsl:call-template name="xref.xreflabel">
184 <xsl:with-param name="target" select="$target"/>
185 </xsl:call-template>
186 </a>
187 </xsl:when>
188
189 <xsl:otherwise>
190 <xsl:variable name="href">
191 <xsl:call-template name="href.target">
192 <xsl:with-param name="object" select="$target"/>
193 </xsl:call-template>
194 </xsl:variable>
195
196 <xsl:if test="not(parent::citation)">
197 <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
198 </xsl:if>
199
200 <a href="{$href}">
201 <xsl:apply-templates select="." mode="class.attribute"/>
202 <xsl:if test="$target/title or $target/info/title">
203 <xsl:attribute name="title">
204 <xsl:apply-templates select="$target" mode="xref-title"/>
205 </xsl:attribute>
206 </xsl:if>
207 <xsl:apply-templates select="$target" mode="xref-to">
208 <xsl:with-param name="referrer" select="."/>
209 <xsl:with-param name="xrefstyle">
210 <xsl:choose>
211 <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0">
212 <xsl:value-of select="@role"/>
213 </xsl:when>
214 <xsl:otherwise>
215 <xsl:value-of select="@xrefstyle"/>
216 </xsl:otherwise>
217 </xsl:choose>
218 </xsl:with-param>
219 </xsl:apply-templates>
220 </a>
221
222 <xsl:if test="not(parent::citation)">
223 <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
224 </xsl:if>
225 </xsl:otherwise>
226 </xsl:choose>
227</xsl:template>
228
229<!-- ==================================================================== -->
230
231<xsl:template match="*" mode="endterm">
232 <!-- Process the children of the endterm element -->
233 <xsl:variable name="endterm">
234 <xsl:apply-templates select="child::node()" mode="no.anchor.mode"/>
235 </xsl:variable>
236
237 <xsl:choose>
238 <xsl:when test="$exsl.node.set.available != 0">
239 <xsl:apply-templates select="exsl:node-set($endterm)" mode="remove-ids"/>
240 </xsl:when>
241 <xsl:otherwise>
242 <xsl:copy-of select="$endterm"/>
243 </xsl:otherwise>
244 </xsl:choose>
245</xsl:template>
246
247<xsl:template match="*" mode="remove-ids">
248 <xsl:choose>
249 <!-- handle html or xhtml -->
250 <xsl:when test="local-name(.) = 'a' and (namespace-uri(.) = '' or namespace-uri(.) = 'http://www.w3.org/1999/xhtml')">
251 <xsl:choose>
252 <xsl:when test="(@name and count(@*) = 1) or (@id and count(@*) = 1) or (@xml:id and count(@*) = 1) or (@xml:id and @name and count(@*) = 2) or (@id and @name and count(@*) = 2)">
253 <xsl:message>suppress anchor</xsl:message>
254 <!-- suppress the whole thing -->
255 </xsl:when>
256 <xsl:otherwise>
257 <xsl:copy>
258 <xsl:for-each select="@*">
259 <xsl:choose>
260 <xsl:when test="local-name(.) != 'name' and local-name(.) != 'id'">
261 <xsl:copy/>
262 </xsl:when>
263 <xsl:otherwise>
264 <xsl:message>removing <xsl:value-of select="local-name(.)"/></xsl:message>
265 </xsl:otherwise>
266 </xsl:choose>
267 </xsl:for-each>
268 </xsl:copy>
269 <xsl:apply-templates mode="remove-ids"/>
270 </xsl:otherwise>
271 </xsl:choose>
272 </xsl:when>
273 <xsl:otherwise>
274 <xsl:copy>
275 <xsl:for-each select="@*">
276 <xsl:choose>
277 <xsl:when test="local-name(.) != 'id'">
278 <xsl:copy/>
279 </xsl:when>
280 <xsl:otherwise>
281 <xsl:message>removing <xsl:value-of select="local-name(.)"/></xsl:message>
282 </xsl:otherwise>
283 </xsl:choose>
284 </xsl:for-each>
285 <xsl:apply-templates mode="remove-ids"/>
286 </xsl:copy>
287 </xsl:otherwise>
288 </xsl:choose>
289</xsl:template>
290
291<!-- ==================================================================== -->
292
293<xsl:template match="*" mode="xref-to-prefix"/>
294<xsl:template match="*" mode="xref-to-suffix"/>
295
296<xsl:template match="*" mode="xref-to">
297 <xsl:param name="referrer"/>
298 <xsl:param name="xrefstyle"/>
299 <xsl:param name="verbose" select="1"/>
300
301 <xsl:if test="$verbose">
302 <xsl:message>
303 <xsl:text>Don't know what gentext to create for xref to: "</xsl:text>
304 <xsl:value-of select="name(.)"/>
305 <xsl:text>", ("</xsl:text>
306 <xsl:value-of select="(@id|@xml:id)[1]"/>
307 <xsl:text>")</xsl:text>
308 </xsl:message>
309 </xsl:if>
310 <xsl:text>???</xsl:text>
311</xsl:template>
312
313<xsl:template match="title" mode="xref-to">
314 <xsl:param name="referrer"/>
315 <xsl:param name="xrefstyle"/>
316 <xsl:param name="verbose" select="1"/>
317
318 <!-- if you xref to a title, xref to the parent... -->
319 <xsl:choose>
320 <!-- FIXME: how reliable is this? -->
321 <xsl:when test="contains(local-name(parent::*), 'info')">
322 <xsl:apply-templates select="parent::*[2]" mode="xref-to">
323 <xsl:with-param name="referrer" select="$referrer"/>
324 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
325 <xsl:with-param name="verbose" select="$verbose"/>
326 </xsl:apply-templates>
327 </xsl:when>
328 <xsl:otherwise>
329 <xsl:apply-templates select="parent::*" mode="xref-to">
330 <xsl:with-param name="referrer" select="$referrer"/>
331 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
332 <xsl:with-param name="verbose" select="$verbose"/>
333 </xsl:apply-templates>
334 </xsl:otherwise>
335 </xsl:choose>
336</xsl:template>
337
338<xsl:template match="abstract|authorblurb|personblurb|bibliodiv|bibliomset |biblioset|blockquote|calloutlist|caution|colophon |constraintdef|formalpara|glossdiv|important|indexdiv |itemizedlist|legalnotice|lot|msg|msgexplan|msgmain |msgrel|msgset|msgsub|note|orderedlist|partintro |productionset|qandadiv|refsynopsisdiv|screenshot|segmentedlist |set|setindex|sidebar|tip|toc|variablelist|warning" mode="xref-to">
339 <xsl:param name="referrer"/>
340 <xsl:param name="xrefstyle"/>
341 <xsl:param name="verbose" select="1"/>
342
343 <!-- catch-all for things with (possibly optional) titles -->
344 <xsl:apply-templates select="." mode="object.xref.markup">
345 <xsl:with-param name="purpose" select="'xref'"/>
346 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
347 <xsl:with-param name="referrer" select="$referrer"/>
348 <xsl:with-param name="verbose" select="$verbose"/>
349 </xsl:apply-templates>
350</xsl:template>
351
352<xsl:template match="author|editor|othercredit|personname" mode="xref-to">
353 <xsl:param name="referrer"/>
354 <xsl:param name="xrefstyle"/>
355
356 <xsl:call-template name="person.name"/>
357</xsl:template>
358
359<xsl:template match="authorgroup" mode="xref-to">
360 <xsl:param name="referrer"/>
361 <xsl:param name="xrefstyle"/>
362
363 <xsl:call-template name="person.name.list"/>
364</xsl:template>
365
366<xsl:template match="figure|example|table|equation" mode="xref-to">
367 <xsl:param name="referrer"/>
368 <xsl:param name="xrefstyle"/>
369 <xsl:param name="verbose" select="1"/>
370
371 <xsl:apply-templates select="." mode="object.xref.markup">
372 <xsl:with-param name="purpose" select="'xref'"/>
373 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
374 <xsl:with-param name="referrer" select="$referrer"/>
375 <xsl:with-param name="verbose" select="$verbose"/>
376 </xsl:apply-templates>
377</xsl:template>
378
379<xsl:template match="procedure" mode="xref-to">
380 <xsl:param name="referrer"/>
381 <xsl:param name="xrefstyle"/>
382 <xsl:param name="verbose"/>
383
384 <xsl:apply-templates select="." mode="object.xref.markup">
385 <xsl:with-param name="purpose" select="'xref'"/>
386 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
387 <xsl:with-param name="referrer" select="$referrer"/>
388 <xsl:with-param name="verbose" select="$verbose"/>
389 </xsl:apply-templates>
390</xsl:template>
391
392<xsl:template match="task" mode="xref-to">
393 <xsl:param name="referrer"/>
394 <xsl:param name="xrefstyle"/>
395 <xsl:param name="verbose"/>
396
397 <xsl:apply-templates select="." mode="object.xref.markup">
398 <xsl:with-param name="purpose" select="'xref'"/>
399 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
400 <xsl:with-param name="referrer" select="$referrer"/>
401 <xsl:with-param name="verbose" select="$verbose"/>
402 </xsl:apply-templates>
403</xsl:template>
404
405<xsl:template match="cmdsynopsis" mode="xref-to">
406 <xsl:apply-templates select="(.//command)[1]" mode="xref"/>
407</xsl:template>
408
409<xsl:template match="funcsynopsis" mode="xref-to">
410 <xsl:apply-templates select="(.//function)[1]" mode="xref"/>
411</xsl:template>
412
413<xsl:template match="dedication|acknowledgements|preface|chapter|appendix|article" mode="xref-to">
414 <xsl:param name="referrer"/>
415 <xsl:param name="xrefstyle"/>
416 <xsl:param name="verbose" select="1"/>
417
418 <xsl:apply-templates select="." mode="object.xref.markup">
419 <xsl:with-param name="purpose" select="'xref'"/>
420 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
421 <xsl:with-param name="referrer" select="$referrer"/>
422 <xsl:with-param name="verbose" select="$verbose"/>
423 </xsl:apply-templates>
424</xsl:template>
425
426<xsl:template match="bibliography" mode="xref-to">
427 <xsl:param name="referrer"/>
428 <xsl:param name="xrefstyle"/>
429 <xsl:param name="verbose" select="1"/>
430
431 <xsl:apply-templates select="." mode="object.xref.markup">
432 <xsl:with-param name="purpose" select="'xref'"/>
433 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
434 <xsl:with-param name="referrer" select="$referrer"/>
435 <xsl:with-param name="verbose" select="$verbose"/>
436 </xsl:apply-templates>
437</xsl:template>
438
439<xsl:template match="biblioentry|bibliomixed" mode="xref-to-prefix">
440 <xsl:text>[</xsl:text>
441</xsl:template>
442
443<xsl:template match="biblioentry|bibliomixed" mode="xref-to-suffix">
444 <xsl:text>]</xsl:text>
445</xsl:template>
446
447<xsl:template match="biblioentry|bibliomixed" mode="xref-to">
448 <xsl:param name="referrer"/>
449 <xsl:param name="xrefstyle"/>
450 <xsl:param name="verbose" select="1"/>
451
452 <!-- handles both biblioentry and bibliomixed -->
453 <xsl:choose>
454 <xsl:when test="string(.) = ''">
455 <xsl:variable name="bib" select="document($bibliography.collection,.)"/>
456 <xsl:variable name="id" select="(@id|@xml:id)[1]"/>
457 <xsl:variable name="entry" select="$bib/bibliography/ *[@id=$id or @xml:id=$id][1]"/>
458 <xsl:choose>
459 <xsl:when test="$entry">
460 <xsl:choose>
461 <xsl:when test="$bibliography.numbered != 0">
462 <xsl:number from="bibliography" count="biblioentry|bibliomixed" level="any" format="1"/>
463 </xsl:when>
464 <xsl:when test="local-name($entry/*[1]) = 'abbrev'">
465 <xsl:apply-templates select="$entry/*[1]" mode="no.anchor.mode"/>
466 </xsl:when>
467 <xsl:otherwise>
468 <xsl:value-of select="(@id|@xml:id)[1]"/>
469 </xsl:otherwise>
470 </xsl:choose>
471 </xsl:when>
472 <xsl:otherwise>
473 <xsl:message>
474 <xsl:text>No bibliography entry: </xsl:text>
475 <xsl:value-of select="$id"/>
476 <xsl:text> found in </xsl:text>
477 <xsl:value-of select="$bibliography.collection"/>
478 </xsl:message>
479 <xsl:value-of select="(@id|@xml:id)[1]"/>
480 </xsl:otherwise>
481 </xsl:choose>
482 </xsl:when>
483 <xsl:otherwise>
484 <xsl:choose>
485 <xsl:when test="$bibliography.numbered != 0">
486 <xsl:number from="bibliography" count="biblioentry|bibliomixed" level="any" format="1"/>
487 </xsl:when>
488 <xsl:when test="local-name(*[1]) = 'abbrev'">
489 <xsl:apply-templates select="*[1]" mode="no.anchor.mode"/>
490 </xsl:when>
491 <xsl:otherwise>
492 <xsl:value-of select="(@id|@xml:id)[1]"/>
493 </xsl:otherwise>
494 </xsl:choose>
495 </xsl:otherwise>
496 </xsl:choose>
497</xsl:template>
498
499<xsl:template match="glossary" mode="xref-to">
500 <xsl:param name="referrer"/>
501 <xsl:param name="xrefstyle"/>
502 <xsl:param name="verbose" select="1"/>
503
504 <xsl:apply-templates select="." mode="object.xref.markup">
505 <xsl:with-param name="purpose" select="'xref'"/>
506 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
507 <xsl:with-param name="referrer" select="$referrer"/>
508 <xsl:with-param name="verbose" select="$verbose"/>
509 </xsl:apply-templates>
510</xsl:template>
511
512<xsl:template match="glossentry" mode="xref-to">
513 <xsl:param name="referrer"/>
514 <xsl:param name="xrefstyle"/>
515 <xsl:param name="verbose" select="1"/>
516 <xsl:choose>
517 <xsl:when test="$glossentry.show.acronym = 'primary'">
518 <xsl:choose>
519 <xsl:when test="acronym|abbrev">
520 <xsl:apply-templates select="(acronym|abbrev)[1]" mode="no.anchor.mode"/>
521 </xsl:when>
522 <xsl:otherwise>
523 <xsl:apply-templates select="glossterm[1]" mode="xref-to">
524 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
525 <xsl:with-param name="referrer" select="$referrer"/>
526 <xsl:with-param name="verbose" select="$verbose"/>
527 </xsl:apply-templates>
528 </xsl:otherwise>
529 </xsl:choose>
530 </xsl:when>
531 <xsl:otherwise>
532 <xsl:apply-templates select="glossterm[1]" mode="xref-to">
533 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
534 <xsl:with-param name="referrer" select="$referrer"/>
535 <xsl:with-param name="verbose" select="$verbose"/>
536 </xsl:apply-templates>
537 </xsl:otherwise>
538 </xsl:choose>
539</xsl:template>
540
541<xsl:template match="glossterm|firstterm" mode="xref-to">
542 <xsl:apply-templates mode="no.anchor.mode"/>
543</xsl:template>
544
545<xsl:template match="index" mode="xref-to">
546 <xsl:param name="referrer"/>
547 <xsl:param name="xrefstyle"/>
548 <xsl:param name="verbose" select="1"/>
549
550 <xsl:apply-templates select="." mode="object.xref.markup">
551 <xsl:with-param name="purpose" select="'xref'"/>
552 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
553 <xsl:with-param name="referrer" select="$referrer"/>
554 <xsl:with-param name="verbose" select="$verbose"/>
555 </xsl:apply-templates>
556</xsl:template>
557
558<xsl:template match="listitem" mode="xref-to">
559 <xsl:param name="referrer"/>
560 <xsl:param name="xrefstyle"/>
561 <xsl:param name="verbose"/>
562
563 <xsl:apply-templates select="." mode="object.xref.markup">
564 <xsl:with-param name="purpose" select="'xref'"/>
565 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
566 <xsl:with-param name="referrer" select="$referrer"/>
567 <xsl:with-param name="verbose" select="$verbose"/>
568 </xsl:apply-templates>
569</xsl:template>
570
571<xsl:template match="section|simplesect |sect1|sect2|sect3|sect4|sect5 |refsect1|refsect2|refsect3|refsection" mode="xref-to">
572 <xsl:param name="referrer"/>
573 <xsl:param name="xrefstyle"/>
574 <xsl:param name="verbose" select="1"/>
575
576 <xsl:apply-templates select="." mode="object.xref.markup">
577 <xsl:with-param name="purpose" select="'xref'"/>
578 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
579 <xsl:with-param name="referrer" select="$referrer"/>
580 <xsl:with-param name="verbose" select="$verbose"/>
581 </xsl:apply-templates>
582 <!-- FIXME: What about "in Chapter X"? -->
583</xsl:template>
584
585<xsl:template match="topic" mode="xref-to">
586 <xsl:param name="referrer"/>
587 <xsl:param name="xrefstyle"/>
588 <xsl:param name="verbose" select="1"/>
589
590 <xsl:apply-templates select="." mode="object.xref.markup">
591 <xsl:with-param name="purpose" select="'xref'"/>
592 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
593 <xsl:with-param name="referrer" select="$referrer"/>
594 <xsl:with-param name="verbose" select="$verbose"/>
595 </xsl:apply-templates>
596</xsl:template>
597
598<xsl:template match="bridgehead" mode="xref-to">
599 <xsl:param name="referrer"/>
600 <xsl:param name="xrefstyle"/>
601 <xsl:param name="verbose" select="1"/>
602
603 <xsl:apply-templates select="." mode="object.xref.markup">
604 <xsl:with-param name="purpose" select="'xref'"/>
605 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
606 <xsl:with-param name="referrer" select="$referrer"/>
607 <xsl:with-param name="verbose" select="$verbose"/>
608 </xsl:apply-templates>
609 <!-- FIXME: What about "in Chapter X"? -->
610</xsl:template>
611
612<xsl:template match="qandaset" mode="xref-to">
613 <xsl:param name="referrer"/>
614 <xsl:param name="xrefstyle"/>
615 <xsl:param name="verbose" select="1"/>
616
617 <xsl:apply-templates select="." mode="object.xref.markup">
618 <xsl:with-param name="purpose" select="'xref'"/>
619 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
620 <xsl:with-param name="referrer" select="$referrer"/>
621 <xsl:with-param name="verbose" select="$verbose"/>
622 </xsl:apply-templates>
623</xsl:template>
624
625<xsl:template match="qandaentry" mode="xref-to">
626 <xsl:param name="referrer"/>
627 <xsl:param name="xrefstyle"/>
628 <xsl:param name="verbose" select="1"/>
629
630 <xsl:apply-templates select="question[1]" mode="xref-to">
631 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
632 <xsl:with-param name="referrer" select="$referrer"/>
633 <xsl:with-param name="verbose" select="$verbose"/>
634 </xsl:apply-templates>
635</xsl:template>
636
637<xsl:template match="question|answer" mode="xref-to">
638 <xsl:param name="referrer"/>
639 <xsl:param name="xrefstyle"/>
640 <xsl:param name="verbose" select="1"/>
641
642 <xsl:choose>
643 <xsl:when test="string-length(label) != 0">
644 <xsl:apply-templates select="." mode="label.markup"/>
645 </xsl:when>
646 <xsl:otherwise>
647 <xsl:apply-templates select="." mode="object.xref.markup">
648 <xsl:with-param name="purpose" select="'xref'"/>
649 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
650 <xsl:with-param name="referrer" select="$referrer"/>
651 <xsl:with-param name="verbose" select="$verbose"/>
652 </xsl:apply-templates>
653 </xsl:otherwise>
654 </xsl:choose>
655</xsl:template>
656
657<xsl:template match="part|reference" mode="xref-to">
658 <xsl:param name="referrer"/>
659 <xsl:param name="xrefstyle"/>
660 <xsl:param name="verbose" select="1"/>
661
662 <xsl:apply-templates select="." mode="object.xref.markup">
663 <xsl:with-param name="purpose" select="'xref'"/>
664 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
665 <xsl:with-param name="referrer" select="$referrer"/>
666 <xsl:with-param name="verbose" select="$verbose"/>
667 </xsl:apply-templates>
668</xsl:template>
669
670<xsl:template match="refentry" mode="xref-to">
671 <xsl:param name="referrer"/>
672 <xsl:param name="xrefstyle"/>
673
674 <xsl:choose>
675 <xsl:when test="refmeta/refentrytitle">
676 <xsl:apply-templates select="refmeta/refentrytitle" mode="no.anchor.mode"/>
677 </xsl:when>
678 <xsl:otherwise>
679 <xsl:apply-templates select="refnamediv/refname[1]" mode="no.anchor.mode"/>
680 </xsl:otherwise>
681 </xsl:choose>
682 <xsl:apply-templates select="refmeta/manvolnum" mode="no.anchor.mode"/>
683</xsl:template>
684
685<xsl:template match="refnamediv" mode="xref-to">
686 <xsl:param name="referrer"/>
687 <xsl:param name="xrefstyle"/>
688 <xsl:param name="verbose" select="1"/>
689
690 <xsl:apply-templates select="refname[1]" mode="xref-to">
691 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
692 <xsl:with-param name="referrer" select="$referrer"/>
693 <xsl:with-param name="verbose" select="$verbose"/>
694 </xsl:apply-templates>
695</xsl:template>
696
697<xsl:template match="refname" mode="xref-to">
698 <xsl:param name="referrer"/>
699 <xsl:param name="xrefstyle"/>
700 <xsl:param name="verbose" select="1"/>
701
702 <xsl:apply-templates mode="xref-to"/>
703</xsl:template>
704
705<xsl:template match="step" mode="xref-to">
706 <xsl:param name="referrer"/>
707 <xsl:param name="xrefstyle"/>
708
709 <xsl:call-template name="gentext">
710 <xsl:with-param name="key" select="'Step'"/>
711 </xsl:call-template>
712 <xsl:text> </xsl:text>
713 <xsl:apply-templates select="." mode="number"/>
714</xsl:template>
715
716<xsl:template match="varlistentry" mode="xref-to">
717 <xsl:param name="referrer"/>
718 <xsl:param name="xrefstyle"/>
719 <xsl:param name="verbose" select="1"/>
720
721 <xsl:apply-templates select="term[1]" mode="xref-to">
722 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
723 <xsl:with-param name="referrer" select="$referrer"/>
724 <xsl:with-param name="verbose" select="$verbose"/>
725 </xsl:apply-templates>
726</xsl:template>
727
728<xsl:template match="primary|secondary|tertiary" mode="xref-to">
729 <xsl:value-of select="."/>
730</xsl:template>
731
732<xsl:template match="indexterm" mode="xref-to">
733 <xsl:value-of select="primary"/>
734</xsl:template>
735
736<xsl:template match="varlistentry/term" mode="xref-to">
737 <xsl:param name="referrer"/>
738 <xsl:param name="xrefstyle"/>
739
740 <xsl:apply-templates mode="no.anchor.mode"/>
741</xsl:template>
742
743<xsl:template match="co" mode="xref-to">
744 <xsl:param name="referrer"/>
745 <xsl:param name="xrefstyle"/>
746
747 <xsl:apply-templates select="." mode="callout-bug"/>
748</xsl:template>
749
750<xsl:template match="area|areaset" mode="xref-to">
751 <xsl:param name="referrer"/>
752 <xsl:param name="xrefstyle"/>
753
754 <xsl:call-template name="callout-bug">
755 <xsl:with-param name="conum">
756 <xsl:apply-templates select="." mode="conumber"/>
757 </xsl:with-param>
758 </xsl:call-template>
759</xsl:template>
760
761<xsl:template match="book" mode="xref-to">
762 <xsl:param name="referrer"/>
763 <xsl:param name="xrefstyle"/>
764 <xsl:param name="verbose" select="1"/>
765
766 <xsl:apply-templates select="." mode="object.xref.markup">
767 <xsl:with-param name="purpose" select="'xref'"/>
768 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
769 <xsl:with-param name="referrer" select="$referrer"/>
770 <xsl:with-param name="verbose" select="$verbose"/>
771 </xsl:apply-templates>
772</xsl:template>
773
774<!-- These are elements for which no link text exists, so an xref to one
775 uses the xrefstyle attribute if specified, or if not it falls back
776 to the container element's link text -->
777<xsl:template match="para|phrase|simpara|anchor|quote" mode="xref-to">
778 <xsl:param name="referrer"/>
779 <xsl:param name="xrefstyle"/>
780 <xsl:param name="verbose" select="1"/>
781
782 <xsl:variable name="context" select="(ancestor::simplesect |ancestor::section |ancestor::sect1 |ancestor::sect2 |ancestor::sect3 |ancestor::sect4 |ancestor::sect5 |ancestor::topic |ancestor::refsection |ancestor::refsect1 |ancestor::refsect2 |ancestor::refsect3 |ancestor::chapter |ancestor::appendix |ancestor::preface |ancestor::partintro |ancestor::dedication |ancestor::acknowledgements |ancestor::colophon |ancestor::bibliography |ancestor::index |ancestor::glossary |ancestor::glossentry |ancestor::listitem |ancestor::varlistentry)[last()]"/>
783
784 <xsl:choose>
785 <xsl:when test="$xrefstyle != ''">
786 <xsl:apply-templates select="." mode="object.xref.markup">
787 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
788 <xsl:with-param name="referrer" select="$referrer"/>
789 <xsl:with-param name="verbose" select="$verbose"/>
790 </xsl:apply-templates>
791 </xsl:when>
792 <xsl:otherwise>
793 <xsl:apply-templates select="$context" mode="xref-to">
794 <xsl:with-param name="purpose" select="'xref'"/>
795 <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
796 <xsl:with-param name="referrer" select="$referrer"/>
797 <xsl:with-param name="verbose" select="$verbose"/>
798 </xsl:apply-templates>
799 </xsl:otherwise>
800 </xsl:choose>
801</xsl:template>
802
803<!-- ==================================================================== -->
804
805<xsl:template match="*" mode="xref-title">
806 <xsl:variable name="title">
807 <xsl:apply-templates select="." mode="object.title.markup"/>
808 </xsl:variable>
809
810 <xsl:value-of select="$title"/>
811</xsl:template>
812
813<xsl:template match="author" mode="xref-title">
814 <xsl:variable name="title">
815 <xsl:call-template name="person.name"/>
816 </xsl:variable>
817
818 <xsl:value-of select="$title"/>
819</xsl:template>
820
821<xsl:template match="authorgroup" mode="xref-title">
822 <xsl:variable name="title">
823 <xsl:call-template name="person.name.list"/>
824 </xsl:variable>
825
826 <xsl:value-of select="$title"/>
827</xsl:template>
828
829<xsl:template match="cmdsynopsis" mode="xref-title">
830 <xsl:variable name="title">
831 <xsl:apply-templates select="(.//command)[1]" mode="xref"/>
832 </xsl:variable>
833
834 <xsl:value-of select="$title"/>
835</xsl:template>
836
837<xsl:template match="funcsynopsis" mode="xref-title">
838 <xsl:variable name="title">
839 <xsl:apply-templates select="(.//function)[1]" mode="xref"/>
840 </xsl:variable>
841
842 <xsl:value-of select="$title"/>
843</xsl:template>
844
845<xsl:template match="biblioentry|bibliomixed" mode="xref-title">
846 <!-- handles both biblioentry and bibliomixed -->
847 <xsl:variable name="title">
848 <xsl:text>[</xsl:text>
849 <xsl:choose>
850 <xsl:when test="local-name(*[1]) = 'abbrev'">
851 <xsl:apply-templates select="*[1]" mode="no.anchor.mode"/>
852 </xsl:when>
853 <xsl:otherwise>
854 <xsl:value-of select="(@id|@xml:id)[1]"/>
855 </xsl:otherwise>
856 </xsl:choose>
857 <xsl:text>]</xsl:text>
858 </xsl:variable>
859
860 <xsl:value-of select="$title"/>
861</xsl:template>
862
863<xsl:template match="step" mode="xref-title">
864 <xsl:call-template name="gentext">
865 <xsl:with-param name="key" select="'Step'"/>
866 </xsl:call-template>
867 <xsl:text> </xsl:text>
868 <xsl:apply-templates select="." mode="number"/>
869</xsl:template>
870
871<xsl:template match="step[not(./title)]" mode="title.markup">
872 <xsl:call-template name="gentext">
873 <xsl:with-param name="key" select="'Step'"/>
874 </xsl:call-template>
875 <xsl:text> </xsl:text>
876 <xsl:apply-templates select="." mode="number"/>
877</xsl:template>
878
879<xsl:template match="co" mode="xref-title">
880 <xsl:variable name="title">
881 <xsl:apply-templates select="." mode="callout-bug"/>
882 </xsl:variable>
883
884 <xsl:value-of select="$title"/>
885</xsl:template>
886
887<!-- ==================================================================== -->
888
889<xsl:template match="link" name="link">
890 <xsl:param name="linkend" select="@linkend"/>
891 <xsl:param name="a.target"/>
892 <xsl:param name="xhref" select="@xlink:href"/>
893
894 <xsl:variable name="content">
895 <xsl:call-template name="anchor"/>
896 <xsl:choose>
897 <xsl:when test="count(child::node()) &gt; 0">
898 <!-- If it has content, use it -->
899 <xsl:apply-templates mode="no.anchor.mode"/>
900 </xsl:when>
901 <!-- else look for an endterm -->
902 <xsl:when test="@endterm">
903 <xsl:variable name="etargets" select="key('id',@endterm)"/>
904 <xsl:variable name="etarget" select="$etargets[1]"/>
905 <xsl:choose>
906 <xsl:when test="count($etarget) = 0">
907 <xsl:message>
908 <xsl:value-of select="count($etargets)"/>
909 <xsl:text>Endterm points to nonexistent ID: </xsl:text>
910 <xsl:value-of select="@endterm"/>
911 </xsl:message>
912 <xsl:text>???</xsl:text>
913 </xsl:when>
914 <xsl:otherwise>
915 <xsl:apply-templates select="$etarget" mode="endterm"/>
916 </xsl:otherwise>
917 </xsl:choose>
918 </xsl:when>
919 <!-- Use the xlink:href if no other text -->
920 <xsl:when test="@xlink:href">
921 <xsl:value-of select="@xlink:href"/>
922 </xsl:when>
923 <xsl:otherwise>
924 <xsl:message>
925 <xsl:text>Link element has no content and no Endterm. </xsl:text>
926 <xsl:text>Nothing to show in the link to </xsl:text>
927 <xsl:value-of select="(@xlink:href|@linkend)[1]"/>
928 </xsl:message>
929 <xsl:text>???</xsl:text>
930 </xsl:otherwise>
931 </xsl:choose>
932 </xsl:variable>
933
934 <xsl:call-template name="simple.xlink">
935 <xsl:with-param name="node" select="."/>
936 <xsl:with-param name="linkend" select="$linkend"/>
937 <xsl:with-param name="content" select="$content"/>
938 <xsl:with-param name="a.target" select="$a.target"/>
939 <xsl:with-param name="xhref" select="$xhref"/>
940 </xsl:call-template>
941
942</xsl:template>
943
944<xsl:template match="ulink" name="ulink">
945 <xsl:param name="url" select="@url"/>
946 <xsl:variable name="link">
947 <a>
948 <xsl:apply-templates select="." mode="common.html.attributes"/>
949 <xsl:if test="@id or @xml:id">
950 <xsl:choose>
951 <xsl:when test="$generate.id.attributes = 0">
952 <xsl:attribute name="id">
953 <xsl:value-of select="(@id|@xml:id)[1]"/>
954 </xsl:attribute>
955 </xsl:when>
956 <xsl:otherwise>
957 <xsl:attribute name="id">
958 <xsl:value-of select="(@id|@xml:id)[1]"/>
959 </xsl:attribute>
960 </xsl:otherwise>
961 </xsl:choose>
962 </xsl:if>
963 <xsl:attribute name="href"><xsl:value-of select="$url"/></xsl:attribute>
964 <xsl:if test="$ulink.target != ''">
965 <xsl:attribute name="target">
966 <xsl:value-of select="$ulink.target"/>
967 </xsl:attribute>
968 </xsl:if>
969 <xsl:choose>
970 <xsl:when test="count(child::node())=0">
971 <xsl:value-of select="$url"/>
972 </xsl:when>
973 <xsl:otherwise>
974 <xsl:apply-templates mode="no.anchor.mode"/>
975 </xsl:otherwise>
976 </xsl:choose>
977 </a>
978 </xsl:variable>
979
980 <xsl:choose>
981 <xsl:when test="function-available('suwl:unwrapLinks')">
982 <xsl:copy-of select="suwl:unwrapLinks($link)"/>
983 </xsl:when>
984 <xsl:otherwise>
985 <xsl:copy-of select="$link"/>
986 </xsl:otherwise>
987 </xsl:choose>
988</xsl:template>
989
990<xsl:template match="olink" name="olink">
991 <!-- olink content may be passed in from xlink olink -->
992 <xsl:param name="content" select="NOTANELEMENT"/>
993
994 <xsl:call-template name="anchor"/>
995
996 <xsl:choose>
997 <!-- olinks resolved by stylesheet and target database -->
998 <xsl:when test="@targetdoc or @targetptr or (@xlink:role=$xolink.role and contains(@xlink:href, '#') )">
999
1000 <xsl:variable name="targetdoc.att">
1001 <xsl:choose>
1002 <xsl:when test="@targetdoc != ''">
1003 <xsl:value-of select="@targetdoc"/>
1004 </xsl:when>
1005 <xsl:when test="@xlink:role=$xolink.role and contains(@xlink:href, '#')">
1006 <xsl:value-of select="substring-before(@xlink:href, '#')"/>
1007 </xsl:when>
1008 </xsl:choose>
1009 </xsl:variable>
1010
1011 <xsl:variable name="targetptr.att">
1012 <xsl:choose>
1013 <xsl:when test="@targetptr != ''">
1014 <xsl:value-of select="@targetptr"/>
1015 </xsl:when>
1016 <xsl:when test="@xlink:role=$xolink.role and contains(@xlink:href, '#')">
1017 <xsl:value-of select="substring-after(@xlink:href, '#')"/>
1018 </xsl:when>
1019 </xsl:choose>
1020 </xsl:variable>
1021
1022 <xsl:variable name="olink.lang">
1023 <xsl:call-template name="l10n.language">
1024 <xsl:with-param name="xref-context" select="true()"/>
1025 </xsl:call-template>
1026 </xsl:variable>
1027
1028 <xsl:variable name="target.database.filename">
1029 <xsl:call-template name="select.target.database">
1030 <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/>
1031 <xsl:with-param name="targetptr.att" select="$targetptr.att"/>
1032 <xsl:with-param name="olink.lang" select="$olink.lang"/>
1033 </xsl:call-template>
1034 </xsl:variable>
1035
1036 <xsl:variable name="target.database" select="document($target.database.filename,/)"/>
1037
1038 <xsl:if test="$olink.debug != 0">
1039 <xsl:message>
1040 <xsl:text>Olink debug: root element of target.database '</xsl:text>
1041 <xsl:value-of select="$target.database.filename"/>
1042 <xsl:text>' is '</xsl:text>
1043 <xsl:value-of select="local-name($target.database/*[1])"/>
1044 <xsl:text>'.</xsl:text>
1045 </xsl:message>
1046 </xsl:if>
1047
1048 <xsl:variable name="olink.key">
1049 <xsl:call-template name="select.olink.key">
1050 <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/>
1051 <xsl:with-param name="targetptr.att" select="$targetptr.att"/>
1052 <xsl:with-param name="olink.lang" select="$olink.lang"/>
1053 <xsl:with-param name="target.database" select="$target.database"/>
1054 </xsl:call-template>
1055 </xsl:variable>
1056
1057 <xsl:if test="string-length($olink.key) = 0">
1058 <xsl:message>
1059 <xsl:text>Error: unresolved olink: </xsl:text>
1060 <xsl:text>targetdoc/targetptr = '</xsl:text>
1061 <xsl:value-of select="$targetdoc.att"/>
1062 <xsl:text>/</xsl:text>
1063 <xsl:value-of select="$targetptr.att"/>
1064 <xsl:text>'.</xsl:text>
1065 </xsl:message>
1066 </xsl:if>
1067
1068 <xsl:variable name="href">
1069 <xsl:call-template name="make.olink.href">
1070 <xsl:with-param name="olink.key" select="$olink.key"/>
1071 <xsl:with-param name="target.database" select="$target.database"/>
1072 </xsl:call-template>
1073 </xsl:variable>
1074
1075 <xsl:variable name="hottext">
1076 <xsl:choose>
1077 <xsl:when test="string-length($content) != 0">
1078 <xsl:copy-of select="$content"/>
1079 </xsl:when>
1080 <xsl:otherwise>
1081 <xsl:call-template name="olink.hottext">
1082 <xsl:with-param name="olink.key" select="$olink.key"/>
1083 <xsl:with-param name="olink.lang" select="$olink.lang"/>
1084 <xsl:with-param name="target.database" select="$target.database"/>
1085 </xsl:call-template>
1086 </xsl:otherwise>
1087 </xsl:choose>
1088 </xsl:variable>
1089
1090 <xsl:variable name="olink.docname.citation">
1091 <xsl:call-template name="olink.document.citation">
1092 <xsl:with-param name="olink.key" select="$olink.key"/>
1093 <xsl:with-param name="target.database" select="$target.database"/>
1094 <xsl:with-param name="olink.lang" select="$olink.lang"/>
1095 </xsl:call-template>
1096 </xsl:variable>
1097
1098 <xsl:variable name="olink.page.citation">
1099 <xsl:call-template name="olink.page.citation">
1100 <xsl:with-param name="olink.key" select="$olink.key"/>
1101 <xsl:with-param name="target.database" select="$target.database"/>
1102 <xsl:with-param name="olink.lang" select="$olink.lang"/>
1103 </xsl:call-template>
1104 </xsl:variable>
1105
1106 <xsl:choose>
1107 <xsl:when test="$href != ''">
1108 <a href="{$href}">
1109 <xsl:apply-templates select="." mode="common.html.attributes"/>
1110 <xsl:call-template name="id.attribute"/>
1111 <xsl:copy-of select="$hottext"/>
1112 </a>
1113 <xsl:copy-of select="$olink.page.citation"/>
1114 <xsl:copy-of select="$olink.docname.citation"/>
1115 </xsl:when>
1116 <xsl:otherwise>
1117 <span class="olink">
1118 <xsl:call-template name="id.attribute"/>
1119 <xsl:copy-of select="$hottext"/>
1120 </span>
1121 <xsl:copy-of select="$olink.page.citation"/>
1122 <xsl:copy-of select="$olink.docname.citation"/>
1123 </xsl:otherwise>
1124 </xsl:choose>
1125
1126 </xsl:when>
1127
1128 <xsl:otherwise>
1129 <xsl:choose>
1130 <xsl:when test="@linkmode or @targetdocent or @localinfo">
1131 <!-- old olink mechanism -->
1132 <xsl:message>
1133 <xsl:text>ERROR: olink using obsolete attributes </xsl:text>
1134 <xsl:text>@linkmode, @targetdocent, @localinfo are </xsl:text>
1135 <xsl:text>not supported.</xsl:text>
1136 </xsl:message>
1137 </xsl:when>
1138 <xsl:otherwise>
1139 <xsl:message>
1140 <xsl:text>ERROR: olink is missing linking attributes.</xsl:text>
1141 </xsl:message>
1142 </xsl:otherwise>
1143 </xsl:choose>
1144 </xsl:otherwise>
1145 </xsl:choose>
1146</xsl:template>
1147
1148<xsl:template match="*" mode="pagenumber.markup">
1149 <!-- no-op in HTML -->
1150</xsl:template>
1151
1152<!-- ==================================================================== -->
1153
1154<xsl:template name="xref.xreflabel">
1155 <!-- called to process an xreflabel...you might use this to make -->
1156 <!-- xreflabels come out in the right font for different targets, -->
1157 <!-- for example. -->
1158 <xsl:param name="target" select="."/>
1159 <xsl:value-of select="$target/@xreflabel"/>
1160</xsl:template>
1161
1162<!-- ==================================================================== -->
1163
1164<xsl:template match="title" mode="xref">
1165 <xsl:apply-templates mode="no.anchor.mode"/>
1166</xsl:template>
1167
1168<xsl:template match="command" mode="xref">
1169 <xsl:call-template name="inline.boldseq"/>
1170</xsl:template>
1171
1172<xsl:template match="function" mode="xref">
1173 <xsl:call-template name="inline.monoseq"/>
1174</xsl:template>
1175
1176<!-- ==================================================================== -->
1177
1178<xsl:template match="*" mode="insert.title.markup">
1179 <xsl:param name="purpose"/>
1180 <xsl:param name="xrefstyle"/>
1181 <xsl:param name="title"/>
1182
1183 <xsl:choose>
1184 <xsl:when test="$purpose = 'xref'">
1185 <xsl:copy-of select="$title"/>
1186 </xsl:when>
1187 <xsl:otherwise>
1188 <xsl:copy-of select="$title"/>
1189 </xsl:otherwise>
1190 </xsl:choose>
1191</xsl:template>
1192
1193<xsl:template match="chapter|appendix" mode="insert.title.markup">
1194 <xsl:param name="purpose"/>
1195 <xsl:param name="xrefstyle"/>
1196 <xsl:param name="title"/>
1197
1198 <xsl:choose>
1199 <xsl:when test="$purpose = 'xref'">
1200 <em>
1201 <xsl:copy-of select="$title"/>
1202 </em>
1203 </xsl:when>
1204 <xsl:otherwise>
1205 <xsl:copy-of select="$title"/>
1206 </xsl:otherwise>
1207 </xsl:choose>
1208</xsl:template>
1209
1210<xsl:template match="*" mode="insert.subtitle.markup">
1211 <xsl:param name="purpose"/>
1212 <xsl:param name="xrefstyle"/>
1213 <xsl:param name="subtitle"/>
1214
1215 <xsl:copy-of select="$subtitle"/>
1216</xsl:template>
1217
1218<xsl:template match="*" mode="insert.label.markup">
1219 <xsl:param name="purpose"/>
1220 <xsl:param name="xrefstyle"/>
1221 <xsl:param name="label"/>
1222
1223 <xsl:copy-of select="$label"/>
1224</xsl:template>
1225
1226<xsl:template match="*" mode="insert.pagenumber.markup">
1227 <xsl:param name="purpose"/>
1228 <xsl:param name="xrefstyle"/>
1229 <xsl:param name="pagenumber"/>
1230
1231 <xsl:copy-of select="$pagenumber"/>
1232</xsl:template>
1233
1234<xsl:template match="*" mode="insert.direction.markup">
1235 <xsl:param name="purpose"/>
1236 <xsl:param name="xrefstyle"/>
1237 <xsl:param name="direction"/>
1238
1239 <xsl:copy-of select="$direction"/>
1240</xsl:template>
1241
1242<xsl:template match="*" mode="insert.olink.docname.markup">
1243 <xsl:param name="purpose"/>
1244 <xsl:param name="xrefstyle"/>
1245 <xsl:param name="docname"/>
1246
1247 <span class="olinkdocname">
1248 <xsl:copy-of select="$docname"/>
1249 </span>
1250
1251</xsl:template>
1252
1253</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.