1<?xml version='1.0'?>
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                xmlns:fo="http://www.w3.org/1999/XSL/Format"
4                version='1.0'>
5
6<!-- ********************************************************************
7     $Id$
8     ********************************************************************
9
10     This file is part of the XSL DocBook Stylesheet distribution.
11     See /README or http://nwalsh.com/docbook/xsl/ for copyright
12     and other information.
13
14     ******************************************************************** -->
15
16<xsl:template name="inline.charseq">
17  <xsl:param name="content">
18    <xsl:apply-templates/>
19  </xsl:param>
20  <xsl:copy-of select="$content"/>
21</xsl:template>
22
23<xsl:template name="inline.monoseq">
24  <xsl:param name="content">
25    <xsl:apply-templates/>
26  </xsl:param>
27  <fo:inline font-family="{$monospace.font.family}">
28    <xsl:copy-of select="$content"/>
29  </fo:inline>
30</xsl:template>
31
32<xsl:template name="inline.boldseq">
33  <xsl:param name="content">
34    <xsl:apply-templates/>
35  </xsl:param>
36  <fo:inline font-weight="bold">
37    <xsl:copy-of select="$content"/>
38  </fo:inline>
39</xsl:template>
40
41<xsl:template name="inline.italicseq">
42  <xsl:param name="content">
43    <xsl:apply-templates/>
44  </xsl:param>
45  <fo:inline font-style="italic">
46    <xsl:copy-of select="$content"/>
47  </fo:inline>
48</xsl:template>
49
50<xsl:template name="inline.boldmonoseq">
51  <xsl:param name="content">
52    <xsl:apply-templates/>
53  </xsl:param>
54  <fo:inline font-weight="bold" font-family="{$monospace.font.family}">
55    <xsl:copy-of select="$content"/>
56  </fo:inline>
57</xsl:template>
58
59<xsl:template name="inline.italicmonoseq">
60  <xsl:param name="content">
61    <xsl:apply-templates/>
62  </xsl:param>
63  <fo:inline font-style="italic" font-family="{$monospace.font.family}">
64    <xsl:copy-of select="$content"/>
65  </fo:inline>
66</xsl:template>
67
68<xsl:template name="inline.superscriptseq">
69  <xsl:param name="content">
70    <xsl:apply-templates/>
71  </xsl:param>
72  <fo:inline vertical-align="super">
73    <xsl:copy-of select="$content"/>
74  </fo:inline>
75</xsl:template>
76
77<xsl:template name="inline.subscriptseq">
78  <xsl:param name="content">
79    <xsl:apply-templates/>
80  </xsl:param>
81  <fo:inline vertical-align="sub">
82    <xsl:copy-of select="$content"/>
83  </fo:inline>
84</xsl:template>
85
86<!-- ==================================================================== -->
87
88<xsl:template match="accel">
89  <xsl:call-template name="inline.charseq"/>
90</xsl:template>
91
92<xsl:template match="action">
93  <xsl:call-template name="inline.charseq"/>
94</xsl:template>
95
96<xsl:template match="application">
97  <xsl:call-template name="inline.charseq"/>
98</xsl:template>
99
100<xsl:template match="classname">
101  <xsl:call-template name="inline.monoseq"/>
102</xsl:template>
103
104<xsl:template match="exceptionname">
105  <xsl:call-template name="inline.monoseq"/>
106</xsl:template>
107
108<xsl:template match="interfacename">
109  <xsl:call-template name="inline.monoseq"/>
110</xsl:template>
111
112<xsl:template match="methodname">
113  <xsl:call-template name="inline.monoseq"/>
114</xsl:template>
115
116<xsl:template match="command">
117  <xsl:call-template name="inline.boldseq"/>
118</xsl:template>
119
120<xsl:template match="computeroutput">
121  <xsl:call-template name="inline.monoseq"/>
122</xsl:template>
123
124<xsl:template match="constant">
125  <xsl:call-template name="inline.monoseq"/>
126</xsl:template>
127
128<xsl:template match="database">
129  <xsl:call-template name="inline.charseq"/>
130</xsl:template>
131
132<xsl:template match="errorcode">
133  <xsl:call-template name="inline.charseq"/>
134</xsl:template>
135
136<xsl:template match="errorname">
137  <xsl:call-template name="inline.charseq"/>
138</xsl:template>
139
140<xsl:template match="errortype">
141  <xsl:call-template name="inline.charseq"/>
142</xsl:template>
143
144<xsl:template match="envar">
145  <xsl:call-template name="inline.monoseq"/>
146</xsl:template>
147
148<xsl:template match="filename">
149  <xsl:call-template name="inline.monoseq"/>
150</xsl:template>
151
152<xsl:template match="function">
153  <xsl:call-template name="inline.monoseq"/>
154</xsl:template>
155
156<xsl:template match="guibutton">
157  <xsl:call-template name="inline.charseq"/>
158</xsl:template>
159
160<xsl:template match="guiicon">
161  <xsl:call-template name="inline.charseq"/>
162</xsl:template>
163
164<xsl:template match="guilabel">
165  <xsl:call-template name="inline.charseq"/>
166</xsl:template>
167
168<xsl:template match="guimenu">
169  <xsl:call-template name="inline.charseq"/>
170</xsl:template>
171
172<xsl:template match="guimenuitem">
173  <xsl:call-template name="inline.charseq"/>
174</xsl:template>
175
176<xsl:template match="guisubmenu">
177  <xsl:call-template name="inline.charseq"/>
178</xsl:template>
179
180<xsl:template match="hardware">
181  <xsl:call-template name="inline.charseq"/>
182</xsl:template>
183
184<xsl:template match="interface">
185  <xsl:call-template name="inline.charseq"/>
186</xsl:template>
187
188<xsl:template match="interfacedefinition">
189  <xsl:call-template name="inline.charseq"/>
190</xsl:template>
191
192<xsl:template match="keycap">
193  <xsl:call-template name="inline.boldseq"/>
194</xsl:template>
195
196<xsl:template match="keycode">
197  <xsl:call-template name="inline.charseq"/>
198</xsl:template>
199
200<xsl:template match="keysym">
201  <xsl:call-template name="inline.charseq"/>
202</xsl:template>
203
204<xsl:template match="literal">
205  <xsl:call-template name="inline.monoseq"/>
206</xsl:template>
207
208<xsl:template match="medialabel">
209  <xsl:call-template name="inline.italicseq"/>
210</xsl:template>
211
212<xsl:template match="shortcut">
213  <xsl:call-template name="inline.boldseq"/>
214</xsl:template>
215
216<xsl:template match="mousebutton">
217  <xsl:call-template name="inline.charseq"/>
218</xsl:template>
219
220<xsl:template match="option">
221  <xsl:call-template name="inline.monoseq"/>
222</xsl:template>
223
224<xsl:template match="parameter">
225  <xsl:call-template name="inline.italicmonoseq"/>
226</xsl:template>
227
228<xsl:template match="property">
229  <xsl:call-template name="inline.charseq"/>
230</xsl:template>
231
232<xsl:template match="prompt">
233  <xsl:call-template name="inline.monoseq"/>
234</xsl:template>
235
236<xsl:template match="replaceable">
237  <xsl:call-template name="inline.italicmonoseq"/>
238</xsl:template>
239
240<xsl:template match="returnvalue">
241  <xsl:call-template name="inline.charseq"/>
242</xsl:template>
243
244<xsl:template match="structfield">
245  <xsl:call-template name="inline.italicmonoseq"/>
246</xsl:template>
247
248<xsl:template match="structname">
249  <xsl:call-template name="inline.charseq"/>
250</xsl:template>
251
252<xsl:template match="symbol">
253  <xsl:call-template name="inline.charseq"/>
254</xsl:template>
255
256<xsl:template match="systemitem">
257  <xsl:call-template name="inline.charseq"/>
258</xsl:template>
259
260<xsl:template match="token">
261  <xsl:call-template name="inline.charseq"/>
262</xsl:template>
263
264<xsl:template match="type">
265  <xsl:call-template name="inline.charseq"/>
266</xsl:template>
267
268<xsl:template match="userinput">
269  <xsl:call-template name="inline.boldmonoseq"/>
270</xsl:template>
271
272<xsl:template match="abbrev">
273  <xsl:call-template name="inline.charseq"/>
274</xsl:template>
275
276<xsl:template match="acronym">
277  <xsl:call-template name="inline.charseq"/>
278</xsl:template>
279
280<xsl:template match="citerefentry">
281  <xsl:call-template name="inline.charseq"/>
282</xsl:template>
283
284<xsl:template match="citetitle">
285  <xsl:call-template name="inline.italicseq"/>
286</xsl:template>
287
288<xsl:template match="emphasis">
289  <xsl:call-template name="inline.italicseq"/>
290</xsl:template>
291
292<xsl:template match="foreignphrase">
293  <xsl:call-template name="inline.italicseq"/>
294</xsl:template>
295
296<xsl:template match="markup">
297  <xsl:call-template name="inline.charseq"/>
298</xsl:template>
299
300<xsl:template match="phrase">
301  <xsl:call-template name="inline.charseq"/>
302</xsl:template>
303
304<xsl:template match="quote">
305  <xsl:variable name="depth">
306    <xsl:call-template name="dot.count">
307      <xsl:with-param name="string"><xsl:number level="multiple"/></xsl:with-param>
308    </xsl:call-template>
309  </xsl:variable>
310  <xsl:choose>
311    <xsl:when test="$depth mod 2 = 0">
312      <xsl:call-template name="gentext.startquote"/>
313      <xsl:call-template name="inline.charseq"/>
314      <xsl:call-template name="gentext.endquote"/>
315    </xsl:when>
316    <xsl:otherwise>
317      <xsl:call-template name="gentext.nestedstartquote"/>
318      <xsl:call-template name="inline.charseq"/>
319      <xsl:call-template name="gentext.nestedendquote"/>
320    </xsl:otherwise>
321  </xsl:choose>
322</xsl:template>
323
324<xsl:template match="varname">
325  <xsl:call-template name="inline.monoseq"/>
326</xsl:template>
327
328<xsl:template match="wordasword">
329  <xsl:call-template name="inline.italicseq"/>
330</xsl:template>
331
332<xsl:template match="lineannotation">
333  <xsl:call-template name="inline.charseq"/>
334</xsl:template>
335
336<xsl:template match="superscript">
337  <xsl:call-template name="inline.superscriptseq"/>
338</xsl:template>
339
340<xsl:template match="subscript">
341  <xsl:call-template name="inline.subscriptseq"/>
342</xsl:template>
343
344<xsl:template match="trademark">
345  <xsl:call-template name="inline.charseq"/>
346  <xsl:if test="@class">
347    <xsl:call-template name="dingbat">
348      <xsl:with-param name="dingbat" select="@class"/>
349    </xsl:call-template>
350  </xsl:if>
351</xsl:template>
352
353<xsl:template match="firstterm">
354  <xsl:call-template name="inline.italicseq"/>
355</xsl:template>
356
357<xsl:template match="glossterm">
358  <xsl:call-template name="inline.charseq"/>
359</xsl:template>
360
361<xsl:template match="sgmltag">
362  <xsl:variable name="class">
363    <xsl:choose>
364      <xsl:when test="@class">
365        <xsl:value-of select="@class"/>
366      </xsl:when>
367      <xsl:otherwise>element</xsl:otherwise>
368    </xsl:choose>
369  </xsl:variable>
370
371  <xsl:choose>
372    <xsl:when test="$class='attribute'">
373      <xsl:call-template name="inline.monoseq"/>
374    </xsl:when>
375    <xsl:when test="$class='attvalue'">
376      <xsl:call-template name="inline.monoseq"/>
377    </xsl:when>
378    <xsl:when test="$class='element'">
379      <xsl:call-template name="inline.monoseq"/>
380    </xsl:when>
381    <xsl:when test="$class='endtag'">
382      <xsl:call-template name="inline.monoseq">
383        <xsl:with-param name="content">
384          <xsl:text>&lt;/</xsl:text>
385          <xsl:apply-templates/>
386          <xsl:text>&gt;</xsl:text>
387        </xsl:with-param>
388      </xsl:call-template>
389    </xsl:when>
390    <xsl:when test="$class='genentity'">
391      <xsl:call-template name="inline.monoseq">
392        <xsl:with-param name="content">
393          <xsl:text>&amp;</xsl:text>
394          <xsl:apply-templates/>
395          <xsl:text>;</xsl:text>
396        </xsl:with-param>
397      </xsl:call-template>
398    </xsl:when>
399    <xsl:when test="$class='numcharref'">
400      <xsl:call-template name="inline.monoseq">
401        <xsl:with-param name="content">
402          <xsl:text>&amp;#</xsl:text>
403          <xsl:apply-templates/>
404          <xsl:text>;</xsl:text>
405        </xsl:with-param>
406      </xsl:call-template>
407    </xsl:when>
408    <xsl:when test="$class='paramentity'">
409      <xsl:call-template name="inline.monoseq">
410        <xsl:with-param name="content">
411          <xsl:text>%</xsl:text>
412          <xsl:apply-templates/>
413          <xsl:text>;</xsl:text>
414        </xsl:with-param>
415      </xsl:call-template>
416    </xsl:when>
417    <xsl:when test="$class='pi'">
418      <xsl:call-template name="inline.monoseq">
419        <xsl:with-param name="content">
420          <xsl:text>&lt;?</xsl:text>
421          <xsl:apply-templates/>
422          <xsl:text>&gt;</xsl:text>
423        </xsl:with-param>
424      </xsl:call-template>
425    </xsl:when>
426    <xsl:when test="$class='xmlpi'">
427      <xsl:call-template name="inline.monoseq">
428        <xsl:with-param name="content">
429          <xsl:text>&lt;?</xsl:text>
430          <xsl:apply-templates/>
431          <xsl:text>?&gt;</xsl:text>
432        </xsl:with-param>
433      </xsl:call-template>
434    </xsl:when>
435    <xsl:when test="$class='starttag'">
436      <xsl:call-template name="inline.monoseq">
437        <xsl:with-param name="content">
438          <xsl:text>&lt;</xsl:text>
439          <xsl:apply-templates/>
440          <xsl:text>&gt;</xsl:text>
441        </xsl:with-param>
442      </xsl:call-template>
443    </xsl:when>
444    <xsl:when test="$class='emptytag'">
445      <xsl:call-template name="inline.monoseq">
446        <xsl:with-param name="content">
447          <xsl:text>&lt;</xsl:text>
448          <xsl:apply-templates/>
449          <xsl:text>/&gt;</xsl:text>
450        </xsl:with-param>
451      </xsl:call-template>
452    </xsl:when>
453    <xsl:when test="$class='sgmlcomment'">
454      <xsl:call-template name="inline.monoseq">
455        <xsl:with-param name="content">
456          <xsl:text>&lt;!--</xsl:text>
457          <xsl:apply-templates/>
458          <xsl:text>--&gt;</xsl:text>
459        </xsl:with-param>
460      </xsl:call-template>
461    </xsl:when>
462    <xsl:otherwise>
463      <xsl:call-template name="inline.charseq"/>
464    </xsl:otherwise>
465  </xsl:choose>
466</xsl:template>
467
468<xsl:template match="email">
469  <xsl:call-template name="inline.monoseq">
470    <xsl:with-param name="content">
471      <xsl:text>&lt;</xsl:text>
472      <xsl:apply-templates/>
473      <xsl:text>&gt;</xsl:text>
474    </xsl:with-param>
475  </xsl:call-template>
476</xsl:template>
477
478<xsl:template match="keycombo">
479  <xsl:variable name="action" select="@action"/>
480  <xsl:variable name="joinchar">
481    <xsl:choose>
482      <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
483      <xsl:when test="$action='simul'">+</xsl:when>
484      <xsl:when test="$action='press'">-</xsl:when>
485      <xsl:when test="$action='click'">-</xsl:when>
486      <xsl:when test="$action='double-click'">-</xsl:when>
487      <xsl:when test="$action='other'"></xsl:when>
488      <xsl:otherwise>-</xsl:otherwise>
489    </xsl:choose>
490  </xsl:variable>
491  <xsl:for-each select="./*">
492    <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
493    <xsl:apply-templates/>
494  </xsl:for-each>
495</xsl:template>
496
497<!-- ==================================================================== -->
498
499<xsl:template match="menuchoice">
500  <xsl:variable name="shortcut" select="/shortcut"/>
501  <xsl:call-template name="process.menuchoice"/>
502  <xsl:if test="$shortcut">
503    <xsl:text> (</xsl:text>
504    <xsl:apply-templates select="$shortcut"/>
505    <xsl:text>)</xsl:text>
506  </xsl:if>
507</xsl:template>
508
509<xsl:template name="process.menuchoice">
510  <xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) -->
511  <xsl:param name="count" select="1"/>
512
513  <xsl:choose>
514    <xsl:when test="$count>count($nodelist)"></xsl:when>
515    <xsl:when test="$count=1">
516      <xsl:apply-templates select="$nodelist[$count=position()]"/>
517      <xsl:call-template name="process.menuchoice">
518        <xsl:with-param name="nodelist" select="$nodelist"/>
519        <xsl:with-param name="count" select="$count+1"/>
520      </xsl:call-template>
521    </xsl:when>
522    <xsl:otherwise>
523      <xsl:variable name="node" select="$nodelist[$count=position()]"/>
524      <xsl:choose>
525        <xsl:when test="name($node)='guimenuitem'
526                        or name($node)='guisubmenu'">
527          <xsl:text>-&gt;</xsl:text>
528        </xsl:when>
529        <xsl:otherwise>+</xsl:otherwise>
530      </xsl:choose>
531      <xsl:apply-templates select="$node"/>
532      <xsl:call-template name="process.menuchoice">
533        <xsl:with-param name="nodelist" select="$nodelist"/>
534        <xsl:with-param name="count" select="$count+1"/>
535      </xsl:call-template>
536    </xsl:otherwise>
537  </xsl:choose>
538</xsl:template>
539
540<!-- ==================================================================== -->
541
542<xsl:template match="optional">
543  <xsl:value-of select="$arg.choice.opt.open.str"/>
544  <xsl:call-template name="inline.charseq"/>
545  <xsl:value-of select="$arg.choice.opt.close.str"/>
546</xsl:template>
547
548<xsl:template match="citation">
549  <!-- todo: biblio-citation-check -->
550  <xsl:text>[</xsl:text>
551  <xsl:call-template name="inline.charseq"/>
552  <xsl:text>]</xsl:text>
553</xsl:template>
554
555<!-- ==================================================================== -->
556
557<xsl:template match="comment|remark">
558  <xsl:if test="$show.comments != 0">
559    <fo:inline font-style="italic">
560      <xsl:call-template name="inline.charseq"/>
561    </fo:inline>
562  </xsl:if>
563</xsl:template>
564
565<!-- ==================================================================== -->
566
567<xsl:template match="productname">
568  <xsl:call-template name="inline.charseq"/>
569  <xsl:if test="@class">
570    <xsl:call-template name="dingbat">
571      <xsl:with-param name="dingbat" select="@class"/>
572    </xsl:call-template>
573  </xsl:if>
574</xsl:template>
575
576<xsl:template match="productnumber">
577  <xsl:call-template name="inline.charseq"/>
578</xsl:template>
579
580<!-- ==================================================================== -->
581
582<xsl:template match="pob|street|city|state|postcode|country|otheraddr">
583  <xsl:call-template name="inline.charseq"/>
584</xsl:template>
585
586<xsl:template match="phone|fax">
587  <xsl:call-template name="inline.charseq"/>
588</xsl:template>
589
590<!-- in Addresses, for example -->
591<xsl:template match="honorific|firstname|surname|lineage|othername">
592  <xsl:call-template name="inline.charseq"/>
593</xsl:template>
594
595<!-- ==================================================================== -->
596
597</xsl:stylesheet>
598
599