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