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