2 <!--#############################################################################
3 |- #############################################################################
6 + ############################################################################## -->
8 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
10 exclude-result-prefixes="doc" version='1.0'>
13 <!--############################################################################# -->
14 <!-- DOCUMENTATION -->
15 <doc:reference id="inline" xmlns="">
17 <releaseinfo role="meta">
20 <author> <firstname>Ramon</firstname> <surname>Casellas</surname> </author>
21 <author> <firstname>James</firstname> <surname>Devenish</surname> </author>
24 <year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year>
25 <holder>Ramon Casellas</holder>
28 <title>Inline <filename>inline.mod.xsl</filename></title>
30 <section><title>Introduction</title>
35 <!--############################################################################# -->
40 <xsl:template name="inline.charseq">
41 <xsl:param name="content">
42 <xsl:apply-templates/>
44 <xsl:copy-of select="$content"/>
47 <xsl:template name="inline.monoseq">
48 <xsl:param name="hyphenation">\docbookhyphenatedot</xsl:param>
49 <xsl:param name="content">
50 <xsl:apply-templates/>
52 <xsl:text>{\texttt{</xsl:text>
53 <xsl:if test="$latex.hyphenation.tttricks='1'"><xsl:value-of select="$hyphenation" /></xsl:if>
54 <xsl:text>{</xsl:text>
55 <xsl:copy-of select="$content"/>
56 <xsl:text>}}}</xsl:text>
59 <xsl:template name="inline.boldseq">
60 <xsl:param name="content">
61 <xsl:apply-templates/>
63 <xsl:text>{\bfseries </xsl:text>
64 <xsl:copy-of select="$content"/>
65 <xsl:text>}</xsl:text>
68 <xsl:template name="inline.italicseq">
69 <xsl:param name="content">
70 <xsl:apply-templates/>
72 <xsl:text>{\em </xsl:text>
73 <xsl:copy-of select="$content"/>
74 <xsl:text>}</xsl:text>
77 <xsl:template name="inline.boldmonoseq">
78 <xsl:param name="hyphenation">\docbookhyphenatedot</xsl:param>
79 <xsl:param name="content">
80 <xsl:apply-templates/>
82 <xsl:text>{\texttt\bfseries{</xsl:text>
83 <xsl:if test="$latex.hyphenation.tttricks='1'"><xsl:value-of select="$hyphenation" /></xsl:if>
84 <xsl:text>{</xsl:text>
85 <xsl:copy-of select="$content"/>
86 <xsl:text>}}}</xsl:text>
89 <xsl:template name="inline.italicmonoseq">
90 <xsl:param name="hyphenation">\docbookhyphenatedot</xsl:param>
91 <xsl:param name="content">
92 <xsl:apply-templates/>
94 <xsl:text>{\texttt\itshape{</xsl:text>
95 <xsl:if test="$latex.hyphenation.tttricks='1'"><xsl:value-of select="$hyphenation" /></xsl:if>
96 <xsl:text>{</xsl:text>
97 <xsl:copy-of select="$content"/>
98 <xsl:text>}}}</xsl:text>
101 <xsl:template name="inline.superscriptseq">
102 <xsl:param name="content">
103 <xsl:apply-templates/>
105 <xsl:text>$^\text{</xsl:text>
106 <xsl:copy-of select="$content"/>
107 <xsl:text>}$</xsl:text>
110 <xsl:template name="inline.subscriptseq">
111 <xsl:param name="content">
112 <xsl:apply-templates/>
114 <xsl:text>$_\text{</xsl:text>
115 <xsl:copy-of select="$content"/>
116 <xsl:text>}$</xsl:text>
124 <!-- ==================================================================== -->
125 <!-- some special cases -->
127 <xsl:template match="author">
128 <xsl:call-template name="person.name"/>
131 <xsl:template match="editor">
132 <xsl:call-template name="person.name"/>
135 <xsl:template match="othercredit">
136 <xsl:call-template name="person.name"/>
139 <xsl:template match="authorinitials">
140 <xsl:call-template name="inline.charseq"/>
143 <!-- ==================================================================== -->
145 <xsl:template match="accel">
146 <xsl:call-template name="inline.charseq"/>
149 <xsl:template match="action">
150 <xsl:call-template name="inline.charseq"/>
153 <xsl:template match="application">
154 <xsl:call-template name="inline.charseq"/>
157 <xsl:template match="classname">
158 <xsl:call-template name="inline.monoseq"/>
161 <xsl:template match="exceptionname">
162 <xsl:call-template name="inline.monoseq"/>
165 <xsl:template match="interfacename">
166 <xsl:call-template name="inline.monoseq"/>
169 <xsl:template match="methodname">
170 <xsl:call-template name="inline.monoseq"/>
173 <xsl:template match="command">
174 <xsl:call-template name="inline.boldseq"/>
177 <xsl:template match="computeroutput">
178 <xsl:call-template name="inline.monoseq"/>
181 <xsl:template match="constant">
182 <xsl:call-template name="inline.monoseq"/>
185 <xsl:template match="database">
186 <xsl:call-template name="inline.charseq"/>
189 <xsl:template match="errorcode">
190 <xsl:call-template name="inline.charseq"/>
193 <xsl:template match="errorname">
194 <xsl:call-template name="inline.charseq"/>
197 <xsl:template match="errortype">
198 <xsl:call-template name="inline.charseq"/>
201 <xsl:template match="envar">
202 <xsl:call-template name="inline.monoseq"/>
205 <xsl:template match="filename">
206 <xsl:call-template name="inline.monoseq"><xsl:with-param name="hyphenation">\docbookhyphenatefilename</xsl:with-param></xsl:call-template>
211 <xsl:template match="function">
213 <xsl:when test="$function.parens != '0'
214 or parameter or function or replaceable"> <xsl:variable name="nodes" select="text()|*"/>
215 <xsl:call-template name="inline.monoseq">
216 <xsl:with-param name="content">
217 <xsl:apply-templates select="$nodes[1]"/>
220 <xsl:text>(</xsl:text>
221 <xsl:apply-templates select="$nodes[position()>1]"/>
222 <xsl:text>)</xsl:text>
225 <xsl:call-template name="inline.monoseq"/>
230 <xsl:template match="function/parameter" priority="2">
231 <xsl:call-template name="inline.italicmonoseq"/>
232 <xsl:if test="following-sibling::*">
233 <xsl:text>, </xsl:text>
237 <xsl:template match="function/replaceable" priority="2">
238 <xsl:call-template name="inline.italicmonoseq"/>
239 <xsl:if test="following-sibling::*">
240 <xsl:text>, </xsl:text>
244 <xsl:template match="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface">
245 <xsl:text>{\sffamily \bfseries </xsl:text>
246 <xsl:call-template name="inline.charseq" />
247 <xsl:text>}</xsl:text>
250 <xsl:template match="hardware">
251 <xsl:call-template name="inline.charseq"/>
254 <xsl:template match="interfacedefinition">
255 <xsl:call-template name="inline.charseq"/>
258 <xsl:template match="keycap|keysym">
259 <xsl:call-template name="inline.boldseq" />
262 <xsl:template match="keycode">
263 <xsl:call-template name="inline.charseq"/>
266 <xsl:template match="literal">
267 <xsl:call-template name="inline.monoseq"/>
270 <xsl:template match="medialabel">
271 <xsl:call-template name="inline.italicseq"/>
274 <xsl:template match="shortcut">
275 <xsl:apply-templates/>
278 <xsl:template match="mousebutton">
279 <xsl:call-template name="inline.charseq"/>
282 <xsl:template match="option">
283 <xsl:call-template name="inline.monoseq"/>
286 <xsl:template match="parameter" priority="1">
287 <xsl:call-template name="inline.italicmonoseq"/>
290 <xsl:template match="property">
291 <xsl:call-template name="inline.charseq"/>
294 <xsl:template match="prompt">
295 <xsl:call-template name="inline.monoseq"/>
298 <xsl:template match="replaceable" priority="1">
299 <xsl:call-template name="inline.italicmonoseq"/>
302 <xsl:template match="returnvalue">
303 <xsl:call-template name="inline.charseq"/>
306 <xsl:template match="structfield">
307 <xsl:call-template name="inline.italicmonoseq"/>
310 <xsl:template match="structname">
311 <xsl:call-template name="inline.charseq"/>
314 <xsl:template match="symbol">
315 <xsl:call-template name="inline.charseq"/>
318 <xsl:template match="systemitem">
319 <xsl:call-template name="inline.monoseq"/>
322 <xsl:template match="token">
323 <xsl:call-template name="inline.charseq"/>
326 <xsl:template match="type">
327 <xsl:call-template name="inline.charseq"/>
330 <xsl:template match="userinput">
331 <xsl:call-template name="inline.boldmonoseq"/>
334 <xsl:template match="abbrev">
335 <xsl:call-template name="inline.charseq"/>
338 <xsl:template match="acronym">
339 <xsl:call-template name="inline.charseq"/>
342 <xsl:template match="citerefentry">
343 <xsl:call-template name="inline.charseq"/>
346 <xsl:template match="citetitle">
347 <xsl:call-template name="inline.italicseq"/>
350 <xsl:template match="emphasis">
351 <xsl:call-template name="inline.italicseq"/>
354 <xsl:template match="emphasis[@role='bold']">
355 <xsl:call-template name="inline.boldseq"/>
358 <xsl:template match="foreignphrase">
359 <xsl:call-template name="inline.italicseq"/>
362 <xsl:template match="markup">
363 <xsl:call-template name="inline.charseq"/>
366 <doc:template match="phrase">
367 <refpurpose> A span of text </refpurpose>
368 <refdescription><para>
369 This is a regular inline sequence.
370 However, if the role attribute is 'tex' or 'latex', the content
371 will be output without LaTeX active-character escaping.
372 </para></refdescription>
374 <xsl:template match="phrase">
376 <xsl:when test="@role='tex' or @role='latex'">
377 <xsl:value-of select="."/>
380 <xsl:call-template name="inline.charseq"/>
385 <xsl:template match="quote">
386 <xsl:call-template name="gentext.nestedstartquote"/>
387 <xsl:call-template name="inline.charseq"/>
388 <xsl:call-template name="gentext.nestedendquote"/>
391 <xsl:template match="varname">
392 <xsl:call-template name="inline.monoseq"/>
395 <xsl:template match="wordasword">
396 <xsl:call-template name="inline.italicseq"/>
399 <xsl:template match="lineannotation">
400 <xsl:call-template name="inline.charseq"/>
403 <xsl:template match="superscript">
404 <xsl:call-template name="inline.superscriptseq"/>
407 <xsl:template match="subscript">
408 <xsl:call-template name="inline.subscriptseq"/>
411 <xsl:template match="trademark">
412 <xsl:call-template name="inline.charseq"/>
413 <xsl:call-template name="dingbat">
414 <xsl:with-param name="dingbat">trademark</xsl:with-param>
418 <xsl:template match="firstterm">
419 <xsl:call-template name="inline.italicseq"/>
422 <xsl:template match="glossterm">
423 <xsl:call-template name="inline.charseq"/>
426 <xsl:template match="keycombo">
427 <xsl:variable name="action" select="@action"/>
428 <xsl:variable name="joinchar">
430 <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
431 <xsl:when test="$action='simul'">+</xsl:when>
432 <xsl:when test="$action='press'">--</xsl:when>
433 <xsl:when test="$action='click'">--</xsl:when>
434 <xsl:when test="$action='double-click'">--</xsl:when>
435 <xsl:when test="$action='other'"></xsl:when>
436 <xsl:otherwise>--</xsl:otherwise>
439 <xsl:for-each select="./*">
440 <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
441 <xsl:apply-templates select="."/>
445 <!-- ==================================================================== -->
447 <xsl:template match="menuchoice">
448 <xsl:variable name="shortcut" select="./shortcut"/>
449 <xsl:call-template name="process.menuchoice"/>
450 <xsl:if test="$shortcut">
451 <xsl:text> (</xsl:text>
452 <xsl:apply-templates select="$shortcut"/>
453 <xsl:text>)</xsl:text>
457 <xsl:template name="process.menuchoice">
458 <xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) -->
459 <xsl:param name="count" select="1"/>
462 <xsl:when test="$count>count($nodelist)"></xsl:when>
463 <xsl:when test="$count=1">
464 <xsl:apply-templates select="$nodelist[$count=position()]"/>
465 <xsl:call-template name="process.menuchoice">
466 <xsl:with-param name="nodelist" select="$nodelist"/>
467 <xsl:with-param name="count" select="$count+1"/>
471 <xsl:variable name="node" select="$nodelist[$count=position()]"/>
473 <xsl:when test="name($node)='guimenuitem'
474 or name($node)='guisubmenu'">
475 <xsl:text> $\to$ </xsl:text>
477 <xsl:otherwise>+</xsl:otherwise>
479 <xsl:apply-templates select="$node"/>
480 <xsl:call-template name="process.menuchoice">
481 <xsl:with-param name="nodelist" select="$nodelist"/>
482 <xsl:with-param name="count" select="$count+1"/>
488 <!-- ==================================================================== -->
490 <xsl:template match="optional">
491 <xsl:value-of select="$arg.choice.opt.open.str"/>
492 <xsl:call-template name="inline.charseq"/>
493 <xsl:value-of select="$arg.choice.opt.close.str"/>
496 <!-- ==================================================================== -->
498 <xsl:template match="comment|remark">
499 <xsl:if test="$show.comments != 0">
500 <i><xsl:call-template name="inline.charseq"/></i>
504 <!-- ==================================================================== -->
506 <xsl:template match="productname">
507 <xsl:call-template name="inline.charseq"/>
510 <xsl:template match="productnumber">
511 <xsl:call-template name="inline.charseq"/>
514 <!-- ==================================================================== -->
516 <xsl:template match="pob|street|city|state|postcode|country|phone|fax|otheraddr">
517 <xsl:call-template name="inline.charseq"/>
520 <!-- ==================================================================== -->