source: trunk/Distribution/XSL/fo/inline.xsl@ 2

Last change on this file since 2 was 2, checked in by jkacer, 18 years ago

Added all DocBook Framework stuff:

  • DocBook DTD
  • Transformation software FOP 0.20.5 and Saxon 6
  • XSL styles
  • Rexx scripts

Also added some WarpIN-related stuff for creation of WarpIN installation packages.
This state corresponds to version 1.0.0 from November 2005, just slightly modified to carry versioning information (Rexx scripts).

File size: 32.4 KB
Line 
1<?xml version='1.0'?>
2<!DOCTYPE xsl:stylesheet [
3 <!ENTITY comment.block.parents "parent::answer|parent::appendix|parent::article|parent::bibliodiv|
4 parent::bibliography|parent::blockquote|parent::caution|parent::chapter|
5 parent::glossary|parent::glossdiv|parent::important|parent::index|
6 parent::indexdiv|parent::listitem|parent::note|parent::orderedlist|
7 parent::partintro|parent::preface|parent::procedure|parent::qandadiv|
8 parent::qandaset|parent::question|parent::refentry|parent::refnamediv|
9 parent::refsect1|parent::refsect2|parent::refsect3|parent::refsection|
10 parent::refsynopsisdiv|parent::sect1|parent::sect2|parent::sect3|parent::sect4|
11 parent::sect5|parent::section|parent::setindex|parent::sidebar|
12 parent::simplesect|parent::taskprerequisites|parent::taskrelated|
13 parent::tasksummary|parent::warning">
14]>
15<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
16 xmlns:fo="http://www.w3.org/1999/XSL/Format"
17 xmlns:xlink='http://www.w3.org/1999/xlink'
18 exclude-result-prefixes="xlink"
19 version='1.0'>
20
21<!-- ********************************************************************
22 $Id: inline.xsl,v 1.42 2005/06/13 07:25:40 xmldoc Exp $
23 ********************************************************************
24
25 This file is part of the XSL DocBook Stylesheet distribution.
26 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
27 and other information.
28
29 ******************************************************************** -->
30
31<xsl:template name="simple.xlink">
32 <xsl:param name="node" select="."/>
33 <xsl:param name="content">
34 <xsl:apply-templates/>
35 </xsl:param>
36
37 <xsl:choose>
38 <xsl:when test="$node/@xlink:type='simple' and $node/@xlink:href">
39 <fo:basic-link>
40 <xsl:attribute name="href">
41 <xsl:choose>
42 <!-- if the href starts with # and does not contain an "(" -->
43 <!-- or if the href starts with #xpointer(id(, it's just an ID -->
44 <xsl:when test="starts-with(@xlink:href,'#')
45 and (not(contains(@xlink:href,'&#40;'))
46 or starts-with(@xlink:href,'#xpointer&#40;id&#40;'))">
47 <xsl:variable name="idref">
48 <xsl:call-template name="xpointer.idref">
49 <xsl:with-param name="xpointer" select="@xlink:href"/>
50 </xsl:call-template>
51 </xsl:variable>
52
53 <xsl:variable name="targets" select="key('id',$idref)"/>
54 <xsl:variable name="target" select="$targets[1]"/>
55
56 <xsl:call-template name="check.id.unique">
57 <xsl:with-param name="linkend" select="@linkend"/>
58 </xsl:call-template>
59
60 <xsl:choose>
61 <xsl:when test="count($target) = 0">
62 <xsl:message>
63 <xsl:text>XLink to nonexistent id: </xsl:text>
64 <xsl:value-of select="$idref"/>
65 </xsl:message>
66 <xsl:text>???</xsl:text>
67 </xsl:when>
68 <xsl:otherwise>
69 <xsl:attribute name="internal-destination">
70 <xsl:value-of select="$target/@id"/>
71 </xsl:attribute>
72 </xsl:otherwise>
73 </xsl:choose>
74 </xsl:when>
75
76 <!-- otherwise it's a URI -->
77 <xsl:otherwise>
78 <xsl:attribute name="internal-destination">
79 <xsl:value-of select="@xlink.href"/>
80 </xsl:attribute>
81 </xsl:otherwise>
82 </xsl:choose>
83 </xsl:attribute>
84 <xsl:copy-of select="$content"/>
85 </fo:basic-link>
86 </xsl:when>
87 <xsl:otherwise>
88 <xsl:copy-of select="$content"/>
89 </xsl:otherwise>
90 </xsl:choose>
91</xsl:template>
92
93<xsl:template name="inline.charseq">
94 <xsl:param name="content">
95 <xsl:apply-templates/>
96 </xsl:param>
97
98 <xsl:choose>
99 <xsl:when test="@dir">
100 <fo:inline>
101 <xsl:attribute name="direction">
102 <xsl:choose>
103 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
104 <xsl:otherwise>rtl</xsl:otherwise>
105 </xsl:choose>
106 </xsl:attribute>
107 <xsl:copy-of select="$content"/>
108 </fo:inline>
109 </xsl:when>
110 <xsl:otherwise>
111 <xsl:copy-of select="$content"/>
112 </xsl:otherwise>
113 </xsl:choose>
114</xsl:template>
115
116<xsl:template name="inline.monoseq">
117 <xsl:param name="content">
118 <xsl:apply-templates/>
119 </xsl:param>
120 <fo:inline xsl:use-attribute-sets="monospace.properties">
121 <xsl:if test="@dir">
122 <xsl:attribute name="direction">
123 <xsl:choose>
124 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
125 <xsl:otherwise>rtl</xsl:otherwise>
126 </xsl:choose>
127 </xsl:attribute>
128 </xsl:if>
129 <xsl:copy-of select="$content"/>
130 </fo:inline>
131</xsl:template>
132
133<xsl:template name="inline.boldseq">
134 <xsl:param name="content">
135 <xsl:apply-templates/>
136 </xsl:param>
137 <fo:inline font-weight="bold">
138 <xsl:if test="@dir">
139 <xsl:attribute name="direction">
140 <xsl:choose>
141 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
142 <xsl:otherwise>rtl</xsl:otherwise>
143 </xsl:choose>
144 </xsl:attribute>
145 </xsl:if>
146 <xsl:copy-of select="$content"/>
147 </fo:inline>
148</xsl:template>
149
150<xsl:template name="inline.italicseq">
151 <xsl:param name="content">
152 <xsl:apply-templates/>
153 </xsl:param>
154 <fo:inline font-style="italic">
155 <xsl:if test="@id">
156 <xsl:attribute name="id">
157 <xsl:value-of select="@id"/>
158 </xsl:attribute>
159 </xsl:if>
160 <xsl:if test="@dir">
161 <xsl:attribute name="direction">
162 <xsl:choose>
163 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
164 <xsl:otherwise>rtl</xsl:otherwise>
165 </xsl:choose>
166 </xsl:attribute>
167 </xsl:if>
168 <xsl:copy-of select="$content"/>
169 </fo:inline>
170</xsl:template>
171
172<xsl:template name="inline.boldmonoseq">
173 <xsl:param name="content">
174 <xsl:apply-templates/>
175 </xsl:param>
176 <fo:inline font-weight="bold" xsl:use-attribute-sets="monospace.properties">
177 <xsl:if test="@id">
178 <xsl:attribute name="id">
179 <xsl:value-of select="@id"/>
180 </xsl:attribute>
181 </xsl:if>
182 <xsl:if test="@dir">
183 <xsl:attribute name="direction">
184 <xsl:choose>
185 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
186 <xsl:otherwise>rtl</xsl:otherwise>
187 </xsl:choose>
188 </xsl:attribute>
189 </xsl:if>
190 <xsl:copy-of select="$content"/>
191 </fo:inline>
192</xsl:template>
193
194<xsl:template name="inline.italicmonoseq">
195 <xsl:param name="content">
196 <xsl:apply-templates/>
197 </xsl:param>
198 <fo:inline font-style="italic" xsl:use-attribute-sets="monospace.properties">
199 <xsl:if test="@id">
200 <xsl:attribute name="id">
201 <xsl:value-of select="@id"/>
202 </xsl:attribute>
203 </xsl:if>
204 <xsl:if test="@dir">
205 <xsl:attribute name="direction">
206 <xsl:choose>
207 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
208 <xsl:otherwise>rtl</xsl:otherwise>
209 </xsl:choose>
210 </xsl:attribute>
211 </xsl:if>
212 <xsl:copy-of select="$content"/>
213 </fo:inline>
214</xsl:template>
215
216<xsl:template name="inline.superscriptseq">
217 <xsl:param name="content">
218 <xsl:apply-templates/>
219 </xsl:param>
220
221 <fo:inline xsl:use-attribute-sets="superscript.properties">
222 <xsl:if test="@id">
223 <xsl:attribute name="id">
224 <xsl:value-of select="@id"/>
225 </xsl:attribute>
226 </xsl:if>
227 <xsl:if test="@dir">
228 <xsl:attribute name="direction">
229 <xsl:choose>
230 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
231 <xsl:otherwise>rtl</xsl:otherwise>
232 </xsl:choose>
233 </xsl:attribute>
234 </xsl:if>
235 <xsl:choose>
236 <xsl:when test="$fop.extensions != 0">
237 <xsl:attribute name="vertical-align">super</xsl:attribute>
238 </xsl:when>
239 <xsl:otherwise>
240 <xsl:attribute name="baseline-shift">super</xsl:attribute>
241 </xsl:otherwise>
242 </xsl:choose>
243 <xsl:copy-of select="$content"/>
244 </fo:inline>
245</xsl:template>
246
247<xsl:template name="inline.subscriptseq">
248 <xsl:param name="content">
249 <xsl:apply-templates/>
250 </xsl:param>
251
252 <fo:inline xsl:use-attribute-sets="subscript.properties">
253 <xsl:if test="@id">
254 <xsl:attribute name="id">
255 <xsl:value-of select="@id"/>
256 </xsl:attribute>
257 </xsl:if>
258 <xsl:if test="@dir">
259 <xsl:attribute name="direction">
260 <xsl:choose>
261 <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
262 <xsl:otherwise>rtl</xsl:otherwise>
263 </xsl:choose>
264 </xsl:attribute>
265 </xsl:if>
266 <xsl:choose>
267 <xsl:when test="$fop.extensions != 0">
268 <xsl:attribute name="vertical-align">sub</xsl:attribute>
269 </xsl:when>
270 <xsl:otherwise>
271 <xsl:attribute name="baseline-shift">sub</xsl:attribute>
272 </xsl:otherwise>
273 </xsl:choose>
274 <xsl:copy-of select="$content"/>
275 </fo:inline>
276</xsl:template>
277
278<!-- ==================================================================== -->
279<!-- some special cases -->
280
281<xsl:template match="author">
282 <xsl:call-template name="person.name"/>
283</xsl:template>
284
285<xsl:template match="editor">
286 <xsl:call-template name="person.name"/>
287</xsl:template>
288
289<xsl:template match="othercredit">
290 <xsl:call-template name="person.name"/>
291</xsl:template>
292
293<xsl:template match="authorinitials">
294 <xsl:call-template name="inline.charseq"/>
295</xsl:template>
296
297<!-- ==================================================================== -->
298
299<xsl:template match="accel">
300 <xsl:call-template name="inline.charseq"/>
301</xsl:template>
302
303<xsl:template match="action">
304 <xsl:call-template name="inline.charseq"/>
305</xsl:template>
306
307<xsl:template match="application">
308 <xsl:call-template name="inline.charseq"/>
309</xsl:template>
310
311<xsl:template match="classname">
312 <xsl:call-template name="inline.monoseq"/>
313</xsl:template>
314
315<xsl:template match="exceptionname">
316 <xsl:call-template name="inline.monoseq"/>
317</xsl:template>
318
319<xsl:template match="interfacename">
320 <xsl:call-template name="inline.monoseq"/>
321</xsl:template>
322
323<xsl:template match="methodname">
324 <xsl:call-template name="inline.monoseq"/>
325</xsl:template>
326
327<xsl:template match="command">
328 <xsl:call-template name="inline.boldseq"/>
329</xsl:template>
330
331<xsl:template match="computeroutput">
332 <xsl:call-template name="inline.monoseq"/>
333</xsl:template>
334
335<xsl:template match="constant">
336 <xsl:call-template name="inline.monoseq"/>
337</xsl:template>
338
339<xsl:template match="database">
340 <xsl:call-template name="inline.charseq"/>
341</xsl:template>
342
343<xsl:template match="errorcode">
344 <xsl:call-template name="inline.charseq"/>
345</xsl:template>
346
347<xsl:template match="errorname">
348 <xsl:call-template name="inline.charseq"/>
349</xsl:template>
350
351<xsl:template match="errortype">
352 <xsl:call-template name="inline.charseq"/>
353</xsl:template>
354
355<xsl:template match="errortext">
356 <xsl:call-template name="inline.charseq"/>
357</xsl:template>
358
359<xsl:template match="envar">
360 <xsl:call-template name="inline.monoseq"/>
361</xsl:template>
362
363<xsl:template match="filename">
364 <xsl:call-template name="inline.monoseq"/>
365</xsl:template>
366
367<xsl:template match="function">
368 <xsl:choose>
369 <xsl:when test="$function.parens != '0'
370 and (parameter or function or replaceable)">
371 <xsl:variable name="nodes" select="text()|*"/>
372 <xsl:call-template name="inline.monoseq">
373 <xsl:with-param name="content">
374 <xsl:call-template name="simple.xlink">
375 <xsl:with-param name="content">
376 <xsl:apply-templates select="$nodes[1]"/>
377 </xsl:with-param>
378 </xsl:call-template>
379 </xsl:with-param>
380 </xsl:call-template>
381 <xsl:text>(</xsl:text>
382 <xsl:apply-templates select="$nodes[position()>1]"/>
383 <xsl:text>)</xsl:text>
384 </xsl:when>
385 <xsl:otherwise>
386 <xsl:call-template name="inline.monoseq"/>
387 </xsl:otherwise>
388 </xsl:choose>
389</xsl:template>
390
391<xsl:template match="function/parameter" priority="2">
392 <xsl:call-template name="inline.italicmonoseq"/>
393 <xsl:if test="following-sibling::*">
394 <xsl:text>, </xsl:text>
395 </xsl:if>
396</xsl:template>
397
398<xsl:template match="function/replaceable" priority="2">
399 <xsl:call-template name="inline.italicmonoseq"/>
400 <xsl:if test="following-sibling::*">
401 <xsl:text>, </xsl:text>
402 </xsl:if>
403</xsl:template>
404
405<xsl:template match="guibutton">
406 <xsl:call-template name="inline.charseq"/>
407</xsl:template>
408
409<xsl:template match="guiicon">
410 <xsl:call-template name="inline.charseq"/>
411</xsl:template>
412
413<xsl:template match="guilabel">
414 <xsl:call-template name="inline.charseq"/>
415</xsl:template>
416
417<xsl:template match="guimenu">
418 <xsl:call-template name="inline.charseq"/>
419</xsl:template>
420
421<xsl:template match="guimenuitem">
422 <xsl:call-template name="inline.charseq"/>
423</xsl:template>
424
425<xsl:template match="guisubmenu">
426 <xsl:call-template name="inline.charseq"/>
427</xsl:template>
428
429<xsl:template match="hardware">
430 <xsl:call-template name="inline.charseq"/>
431</xsl:template>
432
433<xsl:template match="interface">
434 <xsl:call-template name="inline.charseq"/>
435</xsl:template>
436
437<xsl:template match="interfacedefinition">
438 <xsl:call-template name="inline.charseq"/>
439</xsl:template>
440
441<xsl:template match="keycap">
442 <xsl:call-template name="inline.boldseq"/>
443</xsl:template>
444
445<xsl:template match="keycode">
446 <xsl:call-template name="inline.charseq"/>
447</xsl:template>
448
449<xsl:template match="keysym">
450 <xsl:call-template name="inline.charseq"/>
451</xsl:template>
452
453<xsl:template match="literal">
454 <xsl:call-template name="inline.monoseq"/>
455</xsl:template>
456
457<xsl:template match="code">
458 <xsl:call-template name="inline.monoseq"/>
459</xsl:template>
460
461<xsl:template match="medialabel">
462 <xsl:call-template name="inline.italicseq"/>
463</xsl:template>
464
465<xsl:template match="shortcut">
466 <xsl:call-template name="inline.boldseq"/>
467</xsl:template>
468
469<xsl:template match="mousebutton">
470 <xsl:call-template name="inline.charseq"/>
471</xsl:template>
472
473<xsl:template match="option">
474 <xsl:call-template name="inline.monoseq"/>
475</xsl:template>
476
477<xsl:template match="package">
478 <xsl:call-template name="inline.charseq"/>
479</xsl:template>
480
481<xsl:template match="parameter">
482 <xsl:call-template name="inline.italicmonoseq"/>
483</xsl:template>
484
485<xsl:template match="property">
486 <xsl:call-template name="inline.charseq"/>
487</xsl:template>
488
489<xsl:template match="prompt">
490 <xsl:call-template name="inline.monoseq"/>
491</xsl:template>
492
493<xsl:template match="replaceable">
494 <xsl:call-template name="inline.italicmonoseq"/>
495</xsl:template>
496
497<xsl:template match="returnvalue">
498 <xsl:call-template name="inline.charseq"/>
499</xsl:template>
500
501<xsl:template match="structfield">
502 <xsl:call-template name="inline.italicmonoseq"/>
503</xsl:template>
504
505<xsl:template match="structname">
506 <xsl:call-template name="inline.charseq"/>
507</xsl:template>
508
509<xsl:template match="symbol">
510 <xsl:call-template name="inline.charseq"/>
511</xsl:template>
512
513<xsl:template match="systemitem">
514 <xsl:call-template name="inline.monoseq"/>
515</xsl:template>
516
517<xsl:template match="token">
518 <xsl:call-template name="inline.charseq"/>
519</xsl:template>
520
521<xsl:template match="type">
522 <xsl:call-template name="inline.charseq"/>
523</xsl:template>
524
525<xsl:template match="userinput">
526 <xsl:call-template name="inline.boldmonoseq"/>
527</xsl:template>
528
529<xsl:template match="abbrev">
530 <xsl:call-template name="inline.charseq"/>
531</xsl:template>
532
533<xsl:template match="acronym">
534 <xsl:call-template name="inline.charseq"/>
535</xsl:template>
536
537<xsl:template match="citerefentry">
538 <xsl:call-template name="inline.charseq"/>
539</xsl:template>
540
541<xsl:template match="citetitle">
542 <xsl:choose>
543 <xsl:when test="@pubwork = 'article'">
544 <xsl:call-template name="gentext.startquote"/>
545 <xsl:call-template name="inline.charseq"/>
546 <xsl:call-template name="gentext.endquote"/>
547 </xsl:when>
548 <xsl:otherwise>
549 <xsl:call-template name="inline.italicseq"/>
550 </xsl:otherwise>
551 </xsl:choose>
552</xsl:template>
553
554<xsl:template match="emphasis">
555 <xsl:variable name="depth">
556 <xsl:call-template name="dot.count">
557 <xsl:with-param name="string">
558 <xsl:number level="multiple"/>
559 </xsl:with-param>
560 </xsl:call-template>
561 </xsl:variable>
562
563 <xsl:choose>
564 <xsl:when test="@role='bold' or @role='strong'">
565 <xsl:call-template name="inline.boldseq"/>
566 </xsl:when>
567 <xsl:when test="@role='underline'">
568 <fo:inline text-decoration="underline">
569 <xsl:call-template name="inline.charseq"/>
570 </fo:inline>
571 </xsl:when>
572 <xsl:when test="@role='strikethrough'">
573 <fo:inline text-decoration="line-through">
574 <xsl:call-template name="inline.charseq"/>
575 </fo:inline>
576 </xsl:when>
577 <xsl:otherwise>
578 <xsl:choose>
579 <xsl:when test="$depth mod 2 = 1">
580 <fo:inline font-style="normal">
581 <xsl:apply-templates/>
582 </fo:inline>
583 </xsl:when>
584 <xsl:otherwise>
585 <xsl:call-template name="inline.italicseq"/>
586 </xsl:otherwise>
587 </xsl:choose>
588 </xsl:otherwise>
589 </xsl:choose>
590</xsl:template>
591
592<xsl:template match="foreignphrase">
593 <xsl:call-template name="inline.italicseq"/>
594</xsl:template>
595
596<xsl:template match="markup">
597 <xsl:call-template name="inline.charseq"/>
598</xsl:template>
599
600<xsl:template match="phrase">
601 <xsl:call-template name="inline.charseq"/>
602</xsl:template>
603
604<xsl:template match="quote">
605 <xsl:variable name="depth">
606 <xsl:call-template name="dot.count">
607 <xsl:with-param name="string"><xsl:number level="multiple"/></xsl:with-param>
608 </xsl:call-template>
609 </xsl:variable>
610 <xsl:choose>
611 <xsl:when test="$depth mod 2 = 0">
612 <xsl:call-template name="gentext.startquote"/>
613 <xsl:call-template name="inline.charseq"/>
614 <xsl:call-template name="gentext.endquote"/>
615 </xsl:when>
616 <xsl:otherwise>
617 <xsl:call-template name="gentext.nestedstartquote"/>
618 <xsl:call-template name="inline.charseq"/>
619 <xsl:call-template name="gentext.nestedendquote"/>
620 </xsl:otherwise>
621 </xsl:choose>
622</xsl:template>
623
624<xsl:template match="varname">
625 <xsl:call-template name="inline.monoseq"/>
626</xsl:template>
627
628<xsl:template match="wordasword">
629 <xsl:call-template name="inline.italicseq"/>
630</xsl:template>
631
632<xsl:template match="lineannotation">
633 <fo:inline font-style="italic">
634 <xsl:call-template name="inline.charseq"/>
635 </fo:inline>
636</xsl:template>
637
638<xsl:template match="superscript">
639 <xsl:call-template name="inline.superscriptseq"/>
640</xsl:template>
641
642<xsl:template match="subscript">
643 <xsl:call-template name="inline.subscriptseq"/>
644</xsl:template>
645
646<xsl:template match="trademark">
647 <xsl:call-template name="inline.charseq"/>
648 <xsl:choose>
649 <xsl:when test="@class = 'copyright'
650 or @class = 'registered'">
651 <xsl:call-template name="dingbat">
652 <xsl:with-param name="dingbat" select="@class"/>
653 </xsl:call-template>
654 </xsl:when>
655 <xsl:when test="@class = 'service'">
656 <xsl:call-template name="inline.superscriptseq">
657 <xsl:with-param name="content" select="'SM'"/>
658 </xsl:call-template>
659 </xsl:when>
660 <xsl:otherwise>
661 <xsl:call-template name="dingbat">
662 <xsl:with-param name="dingbat" select="'trademark'"/>
663 </xsl:call-template>
664 </xsl:otherwise>
665 </xsl:choose>
666</xsl:template>
667
668<xsl:template match="firstterm">
669 <xsl:call-template name="glossterm">
670 <xsl:with-param name="firstterm" select="1"/>
671 </xsl:call-template>
672</xsl:template>
673
674<xsl:template match="glossterm" name="glossterm">
675 <xsl:param name="firstterm" select="0"/>
676
677 <xsl:choose>
678 <xsl:when test="($firstterm.only.link = 0 or $firstterm = 1) and @linkend">
679 <fo:basic-link internal-destination="{@linkend}"
680 xsl:use-attribute-sets="xref.properties">
681 <xsl:call-template name="inline.italicseq"/>
682 </fo:basic-link>
683 </xsl:when>
684
685 <xsl:when test="not(@linkend)
686 and ($firstterm.only.link = 0 or $firstterm = 1)
687 and ($glossterm.auto.link != 0)
688 and $glossary.collection != ''">
689 <xsl:variable name="term">
690 <xsl:choose>
691 <xsl:when test="@baseform"><xsl:value-of select="@baseform"/></xsl:when>
692 <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
693 </xsl:choose>
694 </xsl:variable>
695 <xsl:variable name="cterm"
696 select="(document($glossary.collection,.)//glossentry[glossterm=$term])[1]"/>
697
698 <xsl:choose>
699 <xsl:when test="not($cterm)">
700 <xsl:message>
701 <xsl:text>There's no entry for </xsl:text>
702 <xsl:value-of select="$term"/>
703 <xsl:text> in </xsl:text>
704 <xsl:value-of select="$glossary.collection"/>
705 </xsl:message>
706 <xsl:call-template name="inline.italicseq"/>
707 </xsl:when>
708 <xsl:otherwise>
709 <xsl:variable name="id">
710 <xsl:choose>
711 <xsl:when test="$cterm/@id">
712 <xsl:value-of select="$cterm/@id"/>
713 </xsl:when>
714 <xsl:otherwise>
715 <xsl:value-of select="generate-id($cterm)"/>
716 </xsl:otherwise>
717 </xsl:choose>
718 </xsl:variable>
719 <fo:basic-link internal-destination="{$id}"
720 xsl:use-attribute-sets="xref.properties">
721 <xsl:call-template name="inline.italicseq"/>
722 </fo:basic-link>
723 </xsl:otherwise>
724 </xsl:choose>
725 </xsl:when>
726
727 <xsl:when test="not(@linkend)
728 and ($firstterm.only.link = 0 or $firstterm = 1)
729 and $glossterm.auto.link != 0">
730 <xsl:variable name="term">
731 <xsl:choose>
732 <xsl:when test="@baseform">
733 <xsl:value-of select="@baseform"/>
734 </xsl:when>
735 <xsl:otherwise>
736 <xsl:value-of select="."/>
737 </xsl:otherwise>
738 </xsl:choose>
739 </xsl:variable>
740
741 <xsl:variable name="targets"
742 select="//glossentry[glossterm=$term or glossterm/@baseform=$term]"/>
743
744 <xsl:variable name="target" select="$targets[1]"/>
745
746 <xsl:choose>
747 <xsl:when test="count($targets)=0">
748 <xsl:message>
749 <xsl:text>Error: no glossentry for glossterm: </xsl:text>
750 <xsl:value-of select="."/>
751 <xsl:text>.</xsl:text>
752 </xsl:message>
753 <xsl:call-template name="inline.italicseq"/>
754 </xsl:when>
755 <xsl:otherwise>
756 <xsl:variable name="termid">
757 <xsl:call-template name="object.id">
758 <xsl:with-param name="object" select="$target"/>
759 </xsl:call-template>
760 </xsl:variable>
761
762 <fo:basic-link internal-destination="{$termid}"
763 xsl:use-attribute-sets="xref.properties">
764 <xsl:call-template name="inline.charseq"/>
765 </fo:basic-link>
766 </xsl:otherwise>
767 </xsl:choose>
768 </xsl:when>
769 <xsl:otherwise>
770 <xsl:call-template name="inline.italicseq"/>
771 </xsl:otherwise>
772 </xsl:choose>
773</xsl:template>
774
775<xsl:template match="termdef">
776 <fo:inline>
777 <xsl:call-template name="gentext.template">
778 <xsl:with-param name="context" select="'termdef'"/>
779 <xsl:with-param name="name" select="'prefix'"/>
780 </xsl:call-template>
781 <xsl:apply-templates/>
782 <xsl:call-template name="gentext.template">
783 <xsl:with-param name="context" select="'termdef'"/>
784 <xsl:with-param name="name" select="'suffix'"/>
785 </xsl:call-template>
786 </fo:inline>
787</xsl:template>
788
789<xsl:template match="sgmltag|tag">
790 <xsl:variable name="class">
791 <xsl:choose>
792 <xsl:when test="@class">
793 <xsl:value-of select="@class"/>
794 </xsl:when>
795 <xsl:otherwise>element</xsl:otherwise>
796 </xsl:choose>
797 </xsl:variable>
798
799 <xsl:choose>
800 <xsl:when test="$class='attribute'">
801 <xsl:call-template name="inline.monoseq"/>
802 </xsl:when>
803 <xsl:when test="$class='attvalue'">
804 <xsl:call-template name="inline.monoseq"/>
805 </xsl:when>
806 <xsl:when test="$class='element'">
807 <xsl:call-template name="inline.monoseq"/>
808 </xsl:when>
809 <xsl:when test="$class='endtag'">
810 <xsl:call-template name="inline.monoseq">
811 <xsl:with-param name="content">
812 <xsl:text>&lt;/</xsl:text>
813 <xsl:apply-templates/>
814 <xsl:text>&gt;</xsl:text>
815 </xsl:with-param>
816 </xsl:call-template>
817 </xsl:when>
818 <xsl:when test="$class='genentity'">
819 <xsl:call-template name="inline.monoseq">
820 <xsl:with-param name="content">
821 <xsl:text>&amp;</xsl:text>
822 <xsl:apply-templates/>
823 <xsl:text>;</xsl:text>
824 </xsl:with-param>
825 </xsl:call-template>
826 </xsl:when>
827 <xsl:when test="$class='numcharref'">
828 <xsl:call-template name="inline.monoseq">
829 <xsl:with-param name="content">
830 <xsl:text>&amp;#</xsl:text>
831 <xsl:apply-templates/>
832 <xsl:text>;</xsl:text>
833 </xsl:with-param>
834 </xsl:call-template>
835 </xsl:when>
836 <xsl:when test="$class='paramentity'">
837 <xsl:call-template name="inline.monoseq">
838 <xsl:with-param name="content">
839 <xsl:text>%</xsl:text>
840 <xsl:apply-templates/>
841 <xsl:text>;</xsl:text>
842 </xsl:with-param>
843 </xsl:call-template>
844 </xsl:when>
845 <xsl:when test="$class='pi'">
846 <xsl:call-template name="inline.monoseq">
847 <xsl:with-param name="content">
848 <xsl:text>&lt;?</xsl:text>
849 <xsl:apply-templates/>
850 <xsl:text>&gt;</xsl:text>
851 </xsl:with-param>
852 </xsl:call-template>
853 </xsl:when>
854 <xsl:when test="$class='xmlpi'">
855 <xsl:call-template name="inline.monoseq">
856 <xsl:with-param name="content">
857 <xsl:text>&lt;?</xsl:text>
858 <xsl:apply-templates/>
859 <xsl:text>?&gt;</xsl:text>
860 </xsl:with-param>
861 </xsl:call-template>
862 </xsl:when>
863 <xsl:when test="$class='starttag'">
864 <xsl:call-template name="inline.monoseq">
865 <xsl:with-param name="content">
866 <xsl:text>&lt;</xsl:text>
867 <xsl:apply-templates/>
868 <xsl:text>&gt;</xsl:text>
869 </xsl:with-param>
870 </xsl:call-template>
871 </xsl:when>
872 <xsl:when test="$class='emptytag'">
873 <xsl:call-template name="inline.monoseq">
874 <xsl:with-param name="content">
875 <xsl:text>&lt;</xsl:text>
876 <xsl:apply-templates/>
877 <xsl:text>/&gt;</xsl:text>
878 </xsl:with-param>
879 </xsl:call-template>
880 </xsl:when>
881 <xsl:when test="$class='sgmlcomment'">
882 <xsl:call-template name="inline.monoseq">
883 <xsl:with-param name="content">
884 <xsl:text>&lt;!--</xsl:text>
885 <xsl:apply-templates/>
886 <xsl:text>--&gt;</xsl:text>
887 </xsl:with-param>
888 </xsl:call-template>
889 </xsl:when>
890 <xsl:otherwise>
891 <xsl:call-template name="inline.charseq"/>
892 </xsl:otherwise>
893 </xsl:choose>
894</xsl:template>
895
896<xsl:template match="email">
897 <xsl:call-template name="inline.monoseq">
898 <xsl:with-param name="content">
899 <fo:inline keep-together.within-line="always" hyphenate="false">
900 <xsl:text>&lt;</xsl:text>
901 <xsl:apply-templates/>
902 <xsl:text>&gt;</xsl:text>
903 </fo:inline>
904 </xsl:with-param>
905 </xsl:call-template>
906</xsl:template>
907
908<xsl:template match="keycombo">
909 <xsl:variable name="action" select="@action"/>
910 <xsl:variable name="joinchar">
911 <xsl:choose>
912 <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
913 <xsl:when test="$action='simul'">+</xsl:when>
914 <xsl:when test="$action='press'">-</xsl:when>
915 <xsl:when test="$action='click'">-</xsl:when>
916 <xsl:when test="$action='double-click'">-</xsl:when>
917 <xsl:when test="$action='other'"></xsl:when>
918 <xsl:otherwise>-</xsl:otherwise>
919 </xsl:choose>
920 </xsl:variable>
921 <xsl:for-each select="*">
922 <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
923 <xsl:apply-templates select="."/>
924 </xsl:for-each>
925</xsl:template>
926
927<xsl:template match="orgname">
928 <xsl:call-template name="inline.charseq"/>
929</xsl:template>
930
931<xsl:template match="uri">
932 <xsl:call-template name="inline.monoseq"/>
933</xsl:template>
934
935<!-- ==================================================================== -->
936
937<xsl:template match="menuchoice">
938 <xsl:variable name="shortcut" select="./shortcut"/>
939 <xsl:call-template name="process.menuchoice"/>
940 <xsl:if test="$shortcut">
941 <xsl:text> (</xsl:text>
942 <xsl:apply-templates select="$shortcut"/>
943 <xsl:text>)</xsl:text>
944 </xsl:if>
945</xsl:template>
946
947<xsl:template name="process.menuchoice">
948 <xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) -->
949 <xsl:param name="count" select="1"/>
950
951 <xsl:variable name="mm.separator">
952 <xsl:choose>
953 <xsl:when test="$fop.extensions != 0 and
954 contains($menuchoice.menu.separator, '&#x2192;')">
955 <fo:inline font-family="Symbol">
956 <xsl:copy-of select="$menuchoice.menu.separator"/>
957 </fo:inline>
958 </xsl:when>
959 <xsl:otherwise>
960 <xsl:copy-of select="$menuchoice.menu.separator"/>
961 </xsl:otherwise>
962 </xsl:choose>
963 </xsl:variable>
964
965 <xsl:choose>
966 <xsl:when test="$count>count($nodelist)"></xsl:when>
967 <xsl:when test="$count=1">
968 <xsl:apply-templates select="$nodelist[$count=position()]"/>
969 <xsl:call-template name="process.menuchoice">
970 <xsl:with-param name="nodelist" select="$nodelist"/>
971 <xsl:with-param name="count" select="$count+1"/>
972 </xsl:call-template>
973 </xsl:when>
974 <xsl:otherwise>
975 <xsl:variable name="node" select="$nodelist[$count=position()]"/>
976 <xsl:choose>
977 <xsl:when test="name($node)='guimenuitem'
978 or name($node)='guisubmenu'">
979 <xsl:copy-of select="$mm.separator"/>
980 </xsl:when>
981 <xsl:otherwise>
982 <xsl:copy-of select="$menuchoice.separator"/>
983 </xsl:otherwise>
984 </xsl:choose>
985 <xsl:apply-templates select="$node"/>
986 <xsl:call-template name="process.menuchoice">
987 <xsl:with-param name="nodelist" select="$nodelist"/>
988 <xsl:with-param name="count" select="$count+1"/>
989 </xsl:call-template>
990 </xsl:otherwise>
991 </xsl:choose>
992</xsl:template>
993
994<!-- ==================================================================== -->
995
996<xsl:template match="optional">
997 <xsl:value-of select="$arg.choice.opt.open.str"/>
998 <xsl:call-template name="inline.charseq"/>
999 <xsl:value-of select="$arg.choice.opt.close.str"/>
1000</xsl:template>
1001
1002<xsl:template match="citation">
1003 <!-- todo: biblio-citation-check -->
1004 <xsl:text>[</xsl:text>
1005 <xsl:call-template name="inline.charseq"/>
1006 <xsl:text>]</xsl:text>
1007</xsl:template>
1008
1009<!-- ==================================================================== -->
1010
1011<xsl:template match="comment[&comment.block.parents;]|remark[&comment.block.parents;]">
1012 <xsl:if test="$show.comments != 0">
1013 <fo:block font-style="italic">
1014 <xsl:call-template name="inline.charseq"/>
1015 </fo:block>
1016 </xsl:if>
1017</xsl:template>
1018
1019<xsl:template match="comment|remark">
1020 <xsl:if test="$show.comments != 0">
1021 <fo:inline font-style="italic">
1022 <xsl:call-template name="inline.charseq"/>
1023 </fo:inline>
1024 </xsl:if>
1025</xsl:template>
1026
1027<!-- ==================================================================== -->
1028
1029<xsl:template match="productname">
1030 <xsl:call-template name="inline.charseq"/>
1031 <xsl:if test="@class">
1032 <xsl:call-template name="dingbat">
1033 <xsl:with-param name="dingbat" select="@class"/>
1034 </xsl:call-template>
1035 </xsl:if>
1036</xsl:template>
1037
1038<xsl:template match="productnumber">
1039 <xsl:call-template name="inline.charseq"/>
1040</xsl:template>
1041
1042<!-- ==================================================================== -->
1043
1044<xsl:template match="pob|street|city|state|postcode|country|otheraddr">
1045 <xsl:call-template name="inline.charseq"/>
1046</xsl:template>
1047
1048<xsl:template match="phone|fax">
1049 <xsl:call-template name="inline.charseq"/>
1050</xsl:template>
1051
1052<!-- in Addresses, for example -->
1053<xsl:template match="honorific|firstname|surname|lineage|othername">
1054 <xsl:call-template name="inline.charseq"/>
1055</xsl:template>
1056
1057<!-- ==================================================================== -->
1058
1059<xsl:template match="personname">
1060 <xsl:call-template name="anchor"/>
1061 <xsl:call-template name="person.name"/>
1062</xsl:template>
1063
1064<!-- ==================================================================== -->
1065
1066<xsl:template match="beginpage">
1067 <!-- does nothing; this *is not* markup to force a page break. -->
1068</xsl:template>
1069
1070</xsl:stylesheet>
1071
Note: See TracBrowser for help on using the repository browser.