2 <!--#############################################################################
3 |- #############################################################################
6 + ############################################################################## -->
9 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
10 xmlns:
doc=
"http://nwalsh.com/xsl/documentation/1.0"
11 exclude-result-prefixes=
"doc" version='
1.0'
>
13 <xsl:template match=
"synopsis">
14 <xsl:call-template name=
"label.id"/>
15 <xsl:apply-templates/>
18 <xsl:template match=
"cmdsynopsis">
19 <xsl:call-template name=
"label.id"/>
20 <xsl:text> \begin{list}{}{\setlength{\itemindent}{-\leftmargin}\setlength{\parsep}{
0mm}}
</xsl:text>
21 <xsl:if test=
"@label!=''">
22 <xsl:text>\item\textbf{
</xsl:text>
23 <xsl:call-template name=
"normalize-scape"><xsl:with-param name=
"string" select=
"@label"/></xsl:call-template>
24 <xsl:text>}
</xsl:text>
26 <xsl:text>\item\raggedright\texttt{
</xsl:text>
27 <xsl:apply-templates/>
28 <xsl:text>}
</xsl:text>
29 <xsl:text>\end{list}
</xsl:text>
33 <xsl:template match=
"cmdsynopsis/command">
34 <xsl:apply-templates />
38 <xsl:template match=
"cmdsynopsis//replaceable" priority=
"2">
39 <xsl:text>{\itshape
</xsl:text>
40 <xsl:apply-templates />
41 <xsl:text>}
</xsl:text>
45 <xsl:template match=
"group|arg">
46 <xsl:variable name=
"choice" select=
"@choice"/>
47 <xsl:variable name=
"rep" select=
"@rep"/>
48 <xsl:variable name=
"sepchar">
50 <xsl:when test=
"ancestor-or-self::*/@sepchar">
51 <xsl:value-of select=
"ancestor-or-self::*/@sepchar"/>
54 <xsl:text> </xsl:text>
58 <xsl:if test=
"position()>1"><xsl:value-of select=
"$sepchar"/></xsl:if>
60 <xsl:when test=
"$choice='plain'">
61 <xsl:value-of select=
"$arg.choice.plain.open.str"/>
63 <xsl:when test=
"$choice='req'">
64 <xsl:value-of select=
"$arg.choice.req.open.str"/>
66 <xsl:when test=
"$choice='opt'">
67 <xsl:value-of select=
"$arg.choice.opt.open.str"/>
70 <xsl:value-of select=
"$arg.choice.def.open.str"/>
73 <xsl:apply-templates/>
75 <xsl:when test=
"$rep='repeat'">
76 <xsl:value-of select=
"$arg.rep.repeat.str"/>
78 <xsl:when test=
"$rep='norepeat'">
79 <xsl:value-of select=
"$arg.rep.norepeat.str"/>
82 <xsl:value-of select=
"$arg.rep.def.str"/>
86 <xsl:when test=
"$choice='plain'">
87 <xsl:value-of select=
"$arg.choice.plain.close.str"/>
89 <xsl:when test=
"$choice='req'">
90 <xsl:value-of select=
"$arg.choice.req.close.str"/>
92 <xsl:when test=
"$choice='opt'">
93 <xsl:value-of select=
"$arg.choice.opt.close.str"/>
96 <xsl:value-of select=
"$arg.choice.def.close.str"/>
101 <xsl:template match=
"group/arg">
102 <xsl:variable name=
"choice" select=
"@choice"/>
103 <xsl:variable name=
"rep" select=
"@rep"/>
104 <xsl:if test=
"position()>1"><xsl:value-of select=
"$arg.or.sep"/></xsl:if>
105 <xsl:apply-templates/>
108 <xsl:template match=
"sbr">
109 <xsl:text> </xsl:text>
112 <!-- ==================================================================== -->
114 <xsl:template match=
"synopfragmentref">
115 <!-- VAR target : -->
116 <xsl:variable name=
"target" select=
"id(@linkend)"/>
118 <xsl:variable name=
"snum">
119 <xsl:apply-templates select=
"$target" mode=
"synopfragment.number"/>
122 <xsl:text> {\em (
</xsl:text> <xsl:value-of select=
"$snum"/> <xsl:text>) }
</xsl:text>
125 <xsl:template match=
"synopfragment" mode=
"synopfragment.number">
126 <xsl:number format=
"1"/>
129 <xsl:template match=
"synopfragment">
130 <xsl:variable name=
"snum">
131 <xsl:apply-templates select=
"." mode=
"synopfragment.number"/>
135 <xsl:text>(
</xsl:text>
136 <xsl:value-of select=
"$snum"/>
137 <xsl:text>)
</xsl:text>
139 <xsl:text> </xsl:text>
140 <xsl:apply-templates/>
145 <xsl:template match=
"funcsynopsis">
146 <xsl:call-template name=
"informal.object"/>
150 <xsl:template match=
"funcsynopsisinfo">
151 <xsl:call-template name=
"verbatim.apply.templates"/>
155 <xsl:template match=
"funcprototype">
156 <xsl:apply-templates/>
157 <xsl:if test=
"$funcsynopsis.style='kr'">
158 <xsl:apply-templates select=
"./paramdef" mode=
"kr-funcsynopsis-mode"/>
162 <xsl:template match=
"funcdef">
163 <xsl:apply-templates/>
166 <xsl:template match=
"funcdef/function">
168 <xsl:when test=
"$funcsynopsis.decoration != 0">
169 <xsl:text>\textbf{
</xsl:text><xsl:apply-templates/><xsl:text> }
</xsl:text>
172 <xsl:apply-templates/>
178 <xsl:template match=
"void">
180 <xsl:when test=
"$funcsynopsis.style='ansi'">
181 <xsl:text>(void);
</xsl:text>
184 <xsl:text>();
</xsl:text>
189 <xsl:template match=
"varargs">
190 <xsl:text>( ... );
</xsl:text>
193 <xsl:template match=
"paramdef">
194 <!-- VAR paramnum -->
195 <xsl:variable name=
"paramnum"> <xsl:number count=
"paramdef" format=
"1"/> </xsl:variable>
197 <xsl:if test=
"$paramnum=1">(
</xsl:if>
199 <xsl:when test=
"$funcsynopsis.style='ansi'">
200 <xsl:apply-templates/>
203 <xsl:apply-templates select=
"./parameter"/>
207 <xsl:when test=
"following-sibling::paramdef">
208 <xsl:text>,
</xsl:text>
211 <xsl:text>);
</xsl:text>
218 <xsl:template match=
"paramdef/parameter">
220 <xsl:when test=
"$funcsynopsis.decoration != 0">
221 <xsl:apply-templates/>
224 <xsl:apply-templates/>
227 <xsl:if test=
"following-sibling::parameter">
228 <xsl:text>,
</xsl:text>
234 <xsl:template match=
"paramdef" mode=
"kr-funcsynopsis-mode">
236 <xsl:apply-templates/>
237 <xsl:text>;
</xsl:text>
240 <xsl:template match=
"funcparams">
241 <xsl:text>(
</xsl:text>
242 <xsl:apply-templates/>
243 <xsl:text>)
</xsl:text>