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