2 <!--#############################################################################
3 | $Id: inline.mod.xsl,v 1.1 2003/04/30 21:39:49 ab Exp $
4 |- #############################################################################
8 + ############################################################################## -->
10 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
12 exclude-result-prefixes="doc" version='1.0'>
15 <!--############################################################################# -->
16 <!-- DOCUMENTATION -->
17 <doc:reference id="inline" xmlns="">
19 <releaseinfo role="meta">
20 $Id: inline.mod.xsl,v 1.1 2003/04/30 21:39:49 ab Exp $
23 <author> <firstname>Ramon</firstname> <surname>Casellas</surname> </author>
24 <author> <firstname>James</firstname> <surname>Devenish</surname> </author>
27 <year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year>
28 <holder>Ramon Casellas</holder>
31 <title>Inline <filename>inline.mod.xsl</filename></title>
33 <section><title>Introduction</title>
38 <!--############################################################################# -->
43 <xsl:template name="inline.charseq">
44 <xsl:param name="content">
45 <xsl:apply-templates/>
47 <xsl:copy-of select="$content"/>
50 <xsl:template name="inline.monoseq">
51 <xsl:param name="hyphenation">\docbookhyphenatedot</xsl:param>
52 <xsl:param name="content">
53 <xsl:apply-templates/>
55 <xsl:text>{\texttt{</xsl:text>
56 <xsl:if test="$latex.hyphenation.tttricks='1'"><xsl:value-of select="$hyphenation" /></xsl:if>
57 <xsl:text>{</xsl:text>
58 <xsl:copy-of select="$content"/>
59 <xsl:text>}}}</xsl:text>
62 <xsl:template name="inline.boldseq">
63 <xsl:param name="content">
64 <xsl:apply-templates/>
66 <xsl:text>{\bfseries </xsl:text>
67 <xsl:copy-of select="$content"/>
68 <xsl:text>}</xsl:text>
71 <xsl:template name="inline.italicseq">
72 <xsl:param name="content">
73 <xsl:apply-templates/>
75 <xsl:text>{\em </xsl:text>
76 <xsl:copy-of select="$content"/>
77 <xsl:text>}</xsl:text>
80 <xsl:template name="inline.boldmonoseq">
81 <xsl:param name="hyphenation">\docbookhyphenatedot</xsl:param>
82 <xsl:param name="content">
83 <xsl:apply-templates/>
85 <xsl:text>{\texttt\bfseries{</xsl:text>
86 <xsl:if test="$latex.hyphenation.tttricks='1'"><xsl:value-of select="$hyphenation" /></xsl:if>
87 <xsl:text>{</xsl:text>
88 <xsl:copy-of select="$content"/>
89 <xsl:text>}}}</xsl:text>
92 <xsl:template name="inline.italicmonoseq">
93 <xsl:param name="hyphenation">\docbookhyphenatedot</xsl:param>
94 <xsl:param name="content">
95 <xsl:apply-templates/>
97 <xsl:text>{\texttt\itshape{</xsl:text>
98 <xsl:if test="$latex.hyphenation.tttricks='1'"><xsl:value-of select="$hyphenation" /></xsl:if>
99 <xsl:text>{</xsl:text>
100 <xsl:copy-of select="$content"/>
101 <xsl:text>}}}</xsl:text>
104 <xsl:template name="inline.superscriptseq">
105 <xsl:param name="content">
106 <xsl:apply-templates/>
108 <xsl:text>$^\text{</xsl:text>
109 <xsl:copy-of select="$content"/>
110 <xsl:text>}$</xsl:text>
113 <xsl:template name="inline.subscriptseq">
114 <xsl:param name="content">
115 <xsl:apply-templates/>
117 <xsl:text>$_\text{</xsl:text>
118 <xsl:copy-of select="$content"/>
119 <xsl:text>}$</xsl:text>
127 <!-- ==================================================================== -->
128 <!-- some special cases -->
130 <xsl:template match="author">
131 <xsl:call-template name="person.name"/>
134 <xsl:template match="editor">
135 <xsl:call-template name="person.name"/>
138 <xsl:template match="othercredit">
139 <xsl:call-template name="person.name"/>
142 <xsl:template match="authorinitials">
143 <xsl:call-template name="inline.charseq"/>
146 <!-- ==================================================================== -->
148 <xsl:template match="accel">
149 <xsl:call-template name="inline.charseq"/>
152 <xsl:template match="action">
153 <xsl:call-template name="inline.charseq"/>
156 <xsl:template match="application">
157 <xsl:call-template name="inline.charseq"/>
160 <xsl:template match="classname">
161 <xsl:call-template name="inline.monoseq"/>
164 <xsl:template match="exceptionname">
165 <xsl:call-template name="inline.monoseq"/>
168 <xsl:template match="interfacename">
169 <xsl:call-template name="inline.monoseq"/>
172 <xsl:template match="methodname">
173 <xsl:call-template name="inline.monoseq"/>
176 <xsl:template match="command">
177 <xsl:call-template name="inline.boldseq"/>
180 <xsl:template match="computeroutput">
181 <xsl:call-template name="inline.monoseq"/>
184 <xsl:template match="constant">
185 <xsl:call-template name="inline.monoseq"/>
188 <xsl:template match="database">
189 <xsl:call-template name="inline.charseq"/>
192 <xsl:template match="errorcode">
193 <xsl:call-template name="inline.charseq"/>
196 <xsl:template match="errorname">
197 <xsl:call-template name="inline.charseq"/>
200 <xsl:template match="errortype">
201 <xsl:call-template name="inline.charseq"/>
204 <xsl:template match="envar">
205 <xsl:call-template name="inline.monoseq"/>
208 <xsl:template match="filename">
209 <xsl:call-template name="inline.monoseq"><xsl:with-param name="hyphenation">\docbookhyphenatefilename</xsl:with-param></xsl:call-template>
214 <xsl:template match="function">
216 <xsl:when test="$function.parens != '0'
217 or parameter or function or replaceable"> <xsl:variable name="nodes" select="text()|*"/>
218 <xsl:call-template name="inline.monoseq">
219 <xsl:with-param name="content">
220 <xsl:apply-templates select="$nodes[1]"/>
223 <xsl:text>(</xsl:text>
224 <xsl:apply-templates select="$nodes[position()>1]"/>
225 <xsl:text>)</xsl:text>
228 <xsl:call-template name="inline.monoseq"/>
233 <xsl:template match="function/parameter" priority="2">
234 <xsl:call-template name="inline.italicmonoseq"/>
235 <xsl:if test="following-sibling::*">
236 <xsl:text>, </xsl:text>
240 <xsl:template match="function/replaceable" priority="2">
241 <xsl:call-template name="inline.italicmonoseq"/>
242 <xsl:if test="following-sibling::*">
243 <xsl:text>, </xsl:text>
247 <xsl:template match="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface">
248 <xsl:text>{\sffamily \bfseries </xsl:text>
249 <xsl:call-template name="inline.charseq" />
250 <xsl:text>}</xsl:text>
253 <xsl:template match="hardware">
254 <xsl:call-template name="inline.charseq"/>
257 <xsl:template match="interfacedefinition">
258 <xsl:call-template name="inline.charseq"/>
261 <xsl:template match="keycap|keysym">
262 <xsl:call-template name="inline.boldseq" />
265 <xsl:template match="keycode">
266 <xsl:call-template name="inline.charseq"/>
269 <xsl:template match="literal">
270 <xsl:call-template name="inline.monoseq"/>
273 <xsl:template match="medialabel">
274 <xsl:call-template name="inline.italicseq"/>
277 <xsl:template match="shortcut">
278 <xsl:apply-templates/>
281 <xsl:template match="mousebutton">
282 <xsl:call-template name="inline.charseq"/>
285 <xsl:template match="option">
286 <xsl:call-template name="inline.monoseq"/>
289 <xsl:template match="parameter" priority="1">
290 <xsl:call-template name="inline.italicmonoseq"/>
293 <xsl:template match="property">
294 <xsl:call-template name="inline.charseq"/>
297 <xsl:template match="prompt">
298 <xsl:call-template name="inline.monoseq"/>
301 <xsl:template match="replaceable" priority="1">
302 <xsl:call-template name="inline.italicmonoseq"/>
305 <xsl:template match="returnvalue">
306 <xsl:call-template name="inline.charseq"/>
309 <xsl:template match="structfield">
310 <xsl:call-template name="inline.italicmonoseq"/>
313 <xsl:template match="structname">
314 <xsl:call-template name="inline.charseq"/>
317 <xsl:template match="symbol">
318 <xsl:call-template name="inline.charseq"/>
321 <xsl:template match="systemitem">
322 <xsl:call-template name="inline.monoseq"/>
325 <xsl:template match="token">
326 <xsl:call-template name="inline.charseq"/>
329 <xsl:template match="type">
330 <xsl:call-template name="inline.charseq"/>
333 <xsl:template match="userinput">
334 <xsl:call-template name="inline.boldmonoseq"/>
337 <xsl:template match="abbrev">
338 <xsl:call-template name="inline.charseq"/>
341 <xsl:template match="acronym">
342 <xsl:call-template name="inline.charseq"/>
345 <xsl:template match="citerefentry">
346 <xsl:call-template name="inline.charseq"/>
349 <xsl:template match="citetitle">
350 <xsl:call-template name="inline.italicseq"/>
353 <xsl:template match="emphasis">
354 <xsl:call-template name="inline.italicseq"/>
357 <xsl:template match="emphasis[@role='bold']">
358 <xsl:call-template name="inline.boldseq"/>
361 <xsl:template match="foreignphrase">
362 <xsl:call-template name="inline.italicseq"/>
365 <xsl:template match="markup">
366 <xsl:call-template name="inline.charseq"/>
369 <doc:template match="phrase">
370 <refpurpose> A span of text </refpurpose>
371 <refdescription><para>
372 This is a regular inline sequence.
373 However, if the role attribute is 'tex' or 'latex', the content
374 will be output without LaTeX active-character escaping.
375 </para></refdescription>
377 <xsl:template match="phrase">
379 <xsl:when test="@role='tex' or @role='latex'">
380 <xsl:value-of select="."/>
383 <xsl:call-template name="inline.charseq"/>
388 <xsl:template match="quote">
389 <xsl:call-template name="gentext.nestedstartquote"/>
390 <xsl:call-template name="inline.charseq"/>
391 <xsl:call-template name="gentext.nestedendquote"/>
394 <xsl:template match="varname">
395 <xsl:call-template name="inline.monoseq"/>
398 <xsl:template match="wordasword">
399 <xsl:call-template name="inline.italicseq"/>
402 <xsl:template match="lineannotation">
403 <xsl:call-template name="inline.charseq"/>
406 <xsl:template match="superscript">
407 <xsl:call-template name="inline.superscriptseq"/>
410 <xsl:template match="subscript">
411 <xsl:call-template name="inline.subscriptseq"/>
414 <xsl:template match="trademark">
415 <xsl:call-template name="inline.charseq"/>
416 <xsl:call-template name="dingbat">
417 <xsl:with-param name="dingbat">trademark</xsl:with-param>
421 <xsl:template match="firstterm">
422 <xsl:call-template name="inline.italicseq"/>
425 <xsl:template match="glossterm">
426 <xsl:call-template name="inline.charseq"/>
429 <xsl:template match="keycombo">
430 <xsl:variable name="action" select="@action"/>
431 <xsl:variable name="joinchar">
433 <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
434 <xsl:when test="$action='simul'">+</xsl:when>
435 <xsl:when test="$action='press'">--</xsl:when>
436 <xsl:when test="$action='click'">--</xsl:when>
437 <xsl:when test="$action='double-click'">--</xsl:when>
438 <xsl:when test="$action='other'"></xsl:when>
439 <xsl:otherwise>--</xsl:otherwise>
442 <xsl:for-each select="./*">
443 <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
444 <xsl:apply-templates select="."/>
448 <!-- ==================================================================== -->
450 <xsl:template match="menuchoice">
451 <xsl:variable name="shortcut" select="./shortcut"/>
452 <xsl:call-template name="process.menuchoice"/>
453 <xsl:if test="$shortcut">
454 <xsl:text> (</xsl:text>
455 <xsl:apply-templates select="$shortcut"/>
456 <xsl:text>)</xsl:text>
460 <xsl:template name="process.menuchoice">
461 <xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) -->
462 <xsl:param name="count" select="1"/>
465 <xsl:when test="$count>count($nodelist)"></xsl:when>
466 <xsl:when test="$count=1">
467 <xsl:apply-templates select="$nodelist[$count=position()]"/>
468 <xsl:call-template name="process.menuchoice">
469 <xsl:with-param name="nodelist" select="$nodelist"/>
470 <xsl:with-param name="count" select="$count+1"/>
474 <xsl:variable name="node" select="$nodelist[$count=position()]"/>
476 <xsl:when test="name($node)='guimenuitem'
477 or name($node)='guisubmenu'">
478 <xsl:text> $\to$ </xsl:text>
480 <xsl:otherwise>+</xsl:otherwise>
482 <xsl:apply-templates select="$node"/>
483 <xsl:call-template name="process.menuchoice">
484 <xsl:with-param name="nodelist" select="$nodelist"/>
485 <xsl:with-param name="count" select="$count+1"/>
491 <!-- ==================================================================== -->
493 <xsl:template match="optional">
494 <xsl:value-of select="$arg.choice.opt.open.str"/>
495 <xsl:call-template name="inline.charseq"/>
496 <xsl:value-of select="$arg.choice.opt.close.str"/>
499 <!-- ==================================================================== -->
501 <xsl:template match="comment|remark">
502 <xsl:if test="$show.comments != 0">
503 <i><xsl:call-template name="inline.charseq"/></i>
507 <!-- ==================================================================== -->
509 <xsl:template match="productname">
510 <xsl:call-template name="inline.charseq"/>
513 <xsl:template match="productnumber">
514 <xsl:call-template name="inline.charseq"/>
517 <!-- ==================================================================== -->
519 <xsl:template match="pob|street|city|state|postcode|country|phone|fax|otheraddr">
520 <xsl:call-template name="inline.charseq"/>
523 <!-- ==================================================================== -->