trying to get HEAD building again. If you want the code
[samba.git] / docs / docbook / xslt / db2latex / inline.mod.xsl
1 <?xml version='1.0'?>
2 <!--############################################################################# 
3 |- #############################################################################
4 |                                                                                                               
5 |   PURPOSE:
6 + ############################################################################## -->
7 <xsl:stylesheet 
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'>
11
12
13     <!--############################################################################# -->
14     <!-- DOCUMENTATION                                                                -->
15     <doc:reference id="inline" xmlns="">
16         <referenceinfo>
17             <releaseinfo role="meta">
18             </releaseinfo>
19         <authorgroup>
20             <author> <firstname>Ramon</firstname> <surname>Casellas</surname> </author>
21             <author> <firstname>James</firstname> <surname>Devenish</surname> </author>
22         </authorgroup>
23             <copyright>
24                 <year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year>
25                 <holder>Ramon Casellas</holder>
26             </copyright>
27         </referenceinfo>
28         <title>Inline <filename>inline.mod.xsl</filename></title>
29         <partintro>
30             <section><title>Introduction</title>
31                 <para></para>
32             </section>
33         </partintro>
34     </doc:reference>
35     <!--############################################################################# -->
36
37
38
39
40     <xsl:template name="inline.charseq">
41         <xsl:param name="content">
42             <xsl:apply-templates/>
43         </xsl:param>
44         <xsl:copy-of select="$content"/>
45     </xsl:template>
46
47     <xsl:template name="inline.monoseq">
48         <xsl:param name="hyphenation">\docbookhyphenatedot</xsl:param>
49         <xsl:param name="content">
50             <xsl:apply-templates/>
51         </xsl:param>
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>
57     </xsl:template>
58
59     <xsl:template name="inline.boldseq">
60         <xsl:param name="content">
61             <xsl:apply-templates/>
62         </xsl:param>
63         <xsl:text>{\bfseries </xsl:text>
64         <xsl:copy-of select="$content"/>
65         <xsl:text>}</xsl:text>
66     </xsl:template>
67
68     <xsl:template name="inline.italicseq">
69         <xsl:param name="content">
70             <xsl:apply-templates/>
71         </xsl:param>
72         <xsl:text>{\em </xsl:text>
73         <xsl:copy-of select="$content"/>
74         <xsl:text>}</xsl:text>
75     </xsl:template>
76
77     <xsl:template name="inline.boldmonoseq">
78         <xsl:param name="hyphenation">\docbookhyphenatedot</xsl:param>
79         <xsl:param name="content">
80             <xsl:apply-templates/>
81         </xsl:param>
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>
87     </xsl:template>
88
89     <xsl:template name="inline.italicmonoseq">
90         <xsl:param name="hyphenation">\docbookhyphenatedot</xsl:param>
91         <xsl:param name="content">
92             <xsl:apply-templates/>
93         </xsl:param>
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>
99     </xsl:template>
100
101     <xsl:template name="inline.superscriptseq">
102         <xsl:param name="content">
103             <xsl:apply-templates/>
104         </xsl:param>
105         <xsl:text>$^\text{</xsl:text>
106         <xsl:copy-of select="$content"/>
107         <xsl:text>}$</xsl:text>
108     </xsl:template>
109
110     <xsl:template name="inline.subscriptseq">
111         <xsl:param name="content">
112             <xsl:apply-templates/>
113         </xsl:param>
114         <xsl:text>$_\text{</xsl:text>
115         <xsl:copy-of select="$content"/>
116         <xsl:text>}$</xsl:text>
117     </xsl:template>
118
119
120
121
122
123
124     <!-- ==================================================================== -->
125     <!-- some special cases -->
126
127     <xsl:template match="author">
128         <xsl:call-template name="person.name"/>
129     </xsl:template>
130
131     <xsl:template match="editor">
132         <xsl:call-template name="person.name"/>
133     </xsl:template>
134
135     <xsl:template match="othercredit">
136         <xsl:call-template name="person.name"/>
137     </xsl:template>
138
139     <xsl:template match="authorinitials">
140         <xsl:call-template name="inline.charseq"/>
141     </xsl:template>
142
143     <!-- ==================================================================== -->
144
145     <xsl:template match="accel">
146         <xsl:call-template name="inline.charseq"/>
147     </xsl:template>
148
149     <xsl:template match="action">
150         <xsl:call-template name="inline.charseq"/>
151     </xsl:template>
152
153     <xsl:template match="application">
154         <xsl:call-template name="inline.charseq"/>
155     </xsl:template>
156
157     <xsl:template match="classname">
158         <xsl:call-template name="inline.monoseq"/>
159     </xsl:template>
160
161     <xsl:template match="exceptionname">
162         <xsl:call-template name="inline.monoseq"/>
163     </xsl:template>
164
165     <xsl:template match="interfacename">
166         <xsl:call-template name="inline.monoseq"/>
167     </xsl:template>
168
169     <xsl:template match="methodname">
170         <xsl:call-template name="inline.monoseq"/>
171     </xsl:template>
172
173     <xsl:template match="command">
174         <xsl:call-template name="inline.boldseq"/>
175     </xsl:template>
176
177     <xsl:template match="computeroutput">
178         <xsl:call-template name="inline.monoseq"/>
179     </xsl:template>
180
181     <xsl:template match="constant">
182         <xsl:call-template name="inline.monoseq"/>
183     </xsl:template>
184
185     <xsl:template match="database">
186         <xsl:call-template name="inline.charseq"/>
187     </xsl:template>
188
189     <xsl:template match="errorcode">
190         <xsl:call-template name="inline.charseq"/>
191     </xsl:template>
192
193     <xsl:template match="errorname">
194         <xsl:call-template name="inline.charseq"/>
195     </xsl:template>
196
197     <xsl:template match="errortype">
198         <xsl:call-template name="inline.charseq"/>
199     </xsl:template>
200
201     <xsl:template match="envar">
202         <xsl:call-template name="inline.monoseq"/>
203     </xsl:template>
204
205     <xsl:template match="filename">
206         <xsl:call-template name="inline.monoseq"><xsl:with-param name="hyphenation">\docbookhyphenatefilename</xsl:with-param></xsl:call-template>
207     </xsl:template>
208
209
210
211     <xsl:template match="function">
212         <xsl:choose>
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]"/>
218                     </xsl:with-param>
219                 </xsl:call-template>
220                 <xsl:text>(</xsl:text>
221                 <xsl:apply-templates select="$nodes[position()>1]"/>
222                 <xsl:text>)</xsl:text>
223             </xsl:when>
224             <xsl:otherwise>
225                 <xsl:call-template name="inline.monoseq"/>
226             </xsl:otherwise>
227         </xsl:choose>
228     </xsl:template>
229
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>
234         </xsl:if>
235     </xsl:template>
236
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>
241         </xsl:if>
242     </xsl:template>
243
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>
248     </xsl:template>
249
250     <xsl:template match="hardware">
251         <xsl:call-template name="inline.charseq"/>
252     </xsl:template>
253
254     <xsl:template match="interfacedefinition">
255         <xsl:call-template name="inline.charseq"/>
256     </xsl:template>
257
258     <xsl:template match="keycap|keysym">
259         <xsl:call-template name="inline.boldseq" />
260     </xsl:template>
261
262     <xsl:template match="keycode">
263         <xsl:call-template name="inline.charseq"/>
264     </xsl:template>
265
266     <xsl:template match="literal">
267         <xsl:call-template name="inline.monoseq"/>
268     </xsl:template>
269
270     <xsl:template match="medialabel">
271         <xsl:call-template name="inline.italicseq"/>
272     </xsl:template>
273
274     <xsl:template match="shortcut">
275         <xsl:apply-templates/>
276     </xsl:template>
277
278     <xsl:template match="mousebutton">
279         <xsl:call-template name="inline.charseq"/>
280     </xsl:template>
281
282     <xsl:template match="option">
283         <xsl:call-template name="inline.monoseq"/>
284     </xsl:template>
285
286     <xsl:template match="parameter" priority="1">
287         <xsl:call-template name="inline.italicmonoseq"/>
288     </xsl:template>
289
290     <xsl:template match="property">
291         <xsl:call-template name="inline.charseq"/>
292     </xsl:template>
293
294     <xsl:template match="prompt">
295         <xsl:call-template name="inline.monoseq"/>
296     </xsl:template>
297
298     <xsl:template match="replaceable" priority="1">
299         <xsl:call-template name="inline.italicmonoseq"/>
300     </xsl:template>
301
302     <xsl:template match="returnvalue">
303         <xsl:call-template name="inline.charseq"/>
304     </xsl:template>
305
306     <xsl:template match="structfield">
307         <xsl:call-template name="inline.italicmonoseq"/>
308     </xsl:template>
309
310     <xsl:template match="structname">
311         <xsl:call-template name="inline.charseq"/>
312     </xsl:template>
313
314     <xsl:template match="symbol">
315         <xsl:call-template name="inline.charseq"/>
316     </xsl:template>
317
318     <xsl:template match="systemitem">
319         <xsl:call-template name="inline.monoseq"/>
320     </xsl:template>
321
322     <xsl:template match="token">
323         <xsl:call-template name="inline.charseq"/>
324     </xsl:template>
325
326     <xsl:template match="type">
327         <xsl:call-template name="inline.charseq"/>
328     </xsl:template>
329
330     <xsl:template match="userinput">
331         <xsl:call-template name="inline.boldmonoseq"/>
332     </xsl:template>
333
334     <xsl:template match="abbrev">
335         <xsl:call-template name="inline.charseq"/>
336     </xsl:template>
337
338     <xsl:template match="acronym">
339         <xsl:call-template name="inline.charseq"/>
340     </xsl:template>
341
342     <xsl:template match="citerefentry">
343         <xsl:call-template name="inline.charseq"/>
344     </xsl:template>
345
346     <xsl:template match="citetitle">
347         <xsl:call-template name="inline.italicseq"/>
348     </xsl:template>
349
350     <xsl:template match="emphasis">
351         <xsl:call-template name="inline.italicseq"/>
352     </xsl:template>
353
354     <xsl:template match="emphasis[@role='bold']">
355         <xsl:call-template name="inline.boldseq"/>
356     </xsl:template>
357
358     <xsl:template match="foreignphrase">
359         <xsl:call-template name="inline.italicseq"/>
360     </xsl:template>
361
362     <xsl:template match="markup">
363         <xsl:call-template name="inline.charseq"/>
364     </xsl:template>
365
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>
373         </doc:template>
374     <xsl:template match="phrase">
375         <xsl:choose>
376                 <xsl:when test="@role='tex' or @role='latex'">
377                         <xsl:value-of select="."/>
378                 </xsl:when>
379                 <xsl:otherwise>
380                         <xsl:call-template name="inline.charseq"/>
381                 </xsl:otherwise>
382         </xsl:choose>
383     </xsl:template>
384
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"/>
389     </xsl:template>
390
391     <xsl:template match="varname">
392         <xsl:call-template name="inline.monoseq"/>
393     </xsl:template>
394
395     <xsl:template match="wordasword">
396         <xsl:call-template name="inline.italicseq"/>
397     </xsl:template>
398
399     <xsl:template match="lineannotation">
400         <xsl:call-template name="inline.charseq"/>
401     </xsl:template>
402
403     <xsl:template match="superscript">
404         <xsl:call-template name="inline.superscriptseq"/>
405     </xsl:template>
406
407     <xsl:template match="subscript">
408         <xsl:call-template name="inline.subscriptseq"/>
409     </xsl:template>
410
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>
415         </xsl:call-template>
416     </xsl:template>
417
418     <xsl:template match="firstterm">
419         <xsl:call-template name="inline.italicseq"/>
420     </xsl:template>
421
422     <xsl:template match="glossterm">
423         <xsl:call-template name="inline.charseq"/>
424     </xsl:template>
425
426     <xsl:template match="keycombo">
427         <xsl:variable name="action" select="@action"/>
428         <xsl:variable name="joinchar">
429             <xsl:choose>
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>
437             </xsl:choose>
438         </xsl:variable>
439         <xsl:for-each select="./*">
440             <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
441             <xsl:apply-templates select="."/>
442         </xsl:for-each>
443     </xsl:template>
444
445     <!-- ==================================================================== -->
446
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>
454         </xsl:if>
455     </xsl:template>
456
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"/>
460
461         <xsl:choose>
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"/>
468                 </xsl:call-template>
469             </xsl:when>
470             <xsl:otherwise>
471                 <xsl:variable name="node" select="$nodelist[$count=position()]"/>
472                 <xsl:choose>
473                     <xsl:when test="name($node)='guimenuitem'
474                         or name($node)='guisubmenu'">
475                         <xsl:text> $\to$ </xsl:text>
476                     </xsl:when>
477                     <xsl:otherwise>+</xsl:otherwise>
478                 </xsl:choose>
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"/>
483                 </xsl:call-template>
484             </xsl:otherwise>
485         </xsl:choose>
486     </xsl:template>
487
488     <!-- ==================================================================== -->
489
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"/>
494     </xsl:template>
495
496     <!-- ==================================================================== -->
497
498     <xsl:template match="comment|remark">
499         <xsl:if test="$show.comments != 0">
500             <i><xsl:call-template name="inline.charseq"/></i>
501         </xsl:if>
502     </xsl:template>
503
504     <!-- ==================================================================== -->
505
506     <xsl:template match="productname">
507         <xsl:call-template name="inline.charseq"/>
508     </xsl:template>
509
510     <xsl:template match="productnumber">
511         <xsl:call-template name="inline.charseq"/>
512     </xsl:template>
513
514     <!-- ==================================================================== -->
515
516     <xsl:template match="pob|street|city|state|postcode|country|phone|fax|otheraddr">
517         <xsl:call-template name="inline.charseq"/>
518     </xsl:template>
519
520     <!-- ==================================================================== -->
521
522 </xsl:stylesheet>
523