]> git.evergreen-ils.org Git - working/Evergreen.git/blob - stylesheets/evergreen_docbook_files/docbook-xsl-1.75.2/xhtml-1_1/synop.xsl
Add stylesheets for our evergreen docbook site.
[working/Evergreen.git] / stylesheets / evergreen_docbook_files / docbook-xsl-1.75.2 / xhtml-1_1 / synop.xsl
1 <?xml version="1.0" encoding="ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
5
6 <!-- ********************************************************************
7      $Id: synop.xsl 8421 2009-05-04 07:49:49Z bobstayton $
8      ********************************************************************
9
10      This file is part of the XSL DocBook Stylesheet distribution.
11      See ../README or http://docbook.sf.net/release/xsl/current/ for
12      copyright and other information.
13
14      ******************************************************************** -->
15
16 <!-- ==================================================================== -->
17
18 <!-- synopsis is in verbatim -->
19
20 <!-- ==================================================================== -->
21
22 <xsl:template match="cmdsynopsis">
23   <div>
24     <xsl:apply-templates select="." mode="common.html.attributes"/>
25     <p>
26       <xsl:if test="..//processing-instruction('dbcmdlist')">
27         <!-- * Placing a dbcmdlist PI as a child of a particular element -->
28         <!-- * creates a hyperlinked list of all cmdsynopsis instances -->
29         <!-- * that are descendants of that element; so for any -->
30         <!-- * cmdsynopsis that is a descendant of an element containing -->
31         <!-- * a dbcmdlist PI, we need to output an a@id instance so that -->
32         <!-- * we will have something to link to -->
33         <xsl:call-template name="anchor">
34           <xsl:with-param name="conditional" select="0"/>
35         </xsl:call-template>
36       </xsl:if>
37       <xsl:apply-templates/>
38     </p>
39   </div>
40 </xsl:template>
41
42 <xsl:template match="cmdsynopsis/command">
43   <br/>
44   <xsl:call-template name="inline.monoseq"/>
45   <xsl:text> </xsl:text>
46 </xsl:template>
47
48 <xsl:template match="cmdsynopsis/command[1]" priority="2">
49   <xsl:call-template name="inline.monoseq"/>
50   <xsl:text> </xsl:text>
51 </xsl:template>
52
53 <xsl:template match="group|arg" name="group-or-arg">
54   <xsl:variable name="choice" select="@choice"/>
55   <xsl:variable name="rep" select="@rep"/>
56   <xsl:variable name="sepchar">
57     <xsl:choose>
58       <xsl:when test="ancestor-or-self::*/@sepchar">
59         <xsl:value-of select="ancestor-or-self::*/@sepchar"/>
60       </xsl:when>
61       <xsl:otherwise>
62         <xsl:text> </xsl:text>
63       </xsl:otherwise>
64     </xsl:choose>
65   </xsl:variable>
66
67   <xsl:if test="preceding-sibling::*">
68     <xsl:value-of select="$sepchar"/>
69   </xsl:if>
70   <xsl:choose>
71     <xsl:when test="$choice='plain'">
72       <xsl:value-of select="$arg.choice.plain.open.str"/>
73     </xsl:when>
74     <xsl:when test="$choice='req'">
75       <xsl:value-of select="$arg.choice.req.open.str"/>
76     </xsl:when>
77     <xsl:when test="$choice='opt'">
78       <xsl:value-of select="$arg.choice.opt.open.str"/>
79     </xsl:when>
80     <xsl:otherwise>
81       <xsl:value-of select="$arg.choice.def.open.str"/>
82     </xsl:otherwise>
83   </xsl:choose>
84   <xsl:apply-templates/>
85   <xsl:choose>
86     <xsl:when test="$rep='repeat'">
87       <xsl:value-of select="$arg.rep.repeat.str"/>
88     </xsl:when>
89     <xsl:when test="$rep='norepeat'">
90       <xsl:value-of select="$arg.rep.norepeat.str"/>
91     </xsl:when>
92     <xsl:otherwise>
93       <xsl:value-of select="$arg.rep.def.str"/>
94     </xsl:otherwise>
95   </xsl:choose>
96   <xsl:choose>
97     <xsl:when test="$choice='plain'">
98       <xsl:value-of select="$arg.choice.plain.close.str"/>
99     </xsl:when>
100     <xsl:when test="$choice='req'">
101       <xsl:value-of select="$arg.choice.req.close.str"/>
102     </xsl:when>
103     <xsl:when test="$choice='opt'">
104       <xsl:value-of select="$arg.choice.opt.close.str"/>
105     </xsl:when>
106     <xsl:otherwise>
107       <xsl:value-of select="$arg.choice.def.close.str"/>
108     </xsl:otherwise>
109   </xsl:choose>
110 </xsl:template>
111
112 <xsl:template match="group/arg">
113   <xsl:variable name="choice" select="@choice"/>
114   <xsl:variable name="rep" select="@rep"/>
115   <xsl:if test="preceding-sibling::*">
116     <xsl:value-of select="$arg.or.sep"/>
117   </xsl:if>
118   <xsl:call-template name="group-or-arg"/>
119 </xsl:template>
120
121 <xsl:template match="sbr">
122   <br/>
123 </xsl:template>
124
125 <!-- ==================================================================== -->
126
127 <xsl:template match="synopfragmentref">
128   <xsl:variable name="target" select="key('id',@linkend)"/>
129   <xsl:variable name="snum">
130     <xsl:apply-templates select="$target" mode="synopfragment.number"/>
131   </xsl:variable>
132   <i>
133     <a href="#{@linkend}">
134       <xsl:text>(</xsl:text>
135       <xsl:value-of select="$snum"/>
136       <xsl:text>)</xsl:text>
137     </a>
138     <xsl:text>&#160;</xsl:text>
139     <xsl:apply-templates/>
140   </i>
141 </xsl:template>
142
143 <xsl:template match="synopfragment" mode="synopfragment.number">
144   <xsl:number format="1"/>
145 </xsl:template>
146
147 <xsl:template match="synopfragment">
148   <xsl:variable name="snum">
149     <xsl:apply-templates select="." mode="synopfragment.number"/>
150   </xsl:variable>
151   <!-- You can't introduce another <p> here, because you're 
152        already in a <p> from cmdsynopsis-->
153   <span>
154     <xsl:variable name="id">
155       <xsl:call-template name="object.id"/>
156     </xsl:variable>
157     <a id="{$id}">
158       <xsl:text>(</xsl:text>
159       <xsl:value-of select="$snum"/>
160       <xsl:text>)</xsl:text>
161     </a>
162     <xsl:text> </xsl:text>
163     <xsl:apply-templates/>
164   </span>
165 </xsl:template>
166
167 <xsl:template match="funcsynopsis">
168   <xsl:if test="..//processing-instruction('dbfunclist')">
169     <!-- * Placing a dbfunclist PI as a child of a particular element -->
170     <!-- * creates a hyperlinked list of all funcsynopsis instances that -->
171     <!-- * are descendants of that element; so for any funcsynopsis that is -->
172     <!-- * a descendant of an element containing a dbfunclist PI, we need -->
173     <!-- * to output an a@id instance so that we will have something to -->
174     <!-- * link to -->
175     <xsl:call-template name="anchor">
176       <xsl:with-param name="conditional" select="0"/>
177     </xsl:call-template>
178   </xsl:if>
179   <xsl:call-template name="informal.object"/>
180 </xsl:template>
181
182 <xsl:template match="funcsynopsisinfo">
183   <pre>
184     <xsl:apply-templates select="." mode="common.html.attributes"/>
185     <xsl:apply-templates/>
186   </pre>
187 </xsl:template>
188
189 <!-- ====================================================================== -->
190 <!-- funcprototype -->
191 <!--
192
193 funcprototype ::= (funcdef,
194                    (void|varargs|paramdef+))
195
196 funcdef       ::= (#PCDATA|type|replaceable|function)*
197
198 paramdef      ::= (#PCDATA|type|replaceable|parameter|funcparams)*
199 -->
200
201 <xsl:template match="funcprototype">
202   <xsl:variable name="html-style">
203     <xsl:call-template name="pi.dbhtml_funcsynopsis-style">
204       <xsl:with-param name="node" select="ancestor::funcsynopsis/descendant-or-self::*"/>
205     </xsl:call-template>
206   </xsl:variable>
207
208   <xsl:variable name="style">
209     <xsl:choose>
210       <xsl:when test="$html-style != ''">
211         <xsl:value-of select="$html-style"/>
212       </xsl:when>
213       <xsl:otherwise>
214         <xsl:value-of select="$funcsynopsis.style"/>
215       </xsl:otherwise>
216     </xsl:choose>
217   </xsl:variable>
218
219 <!-- * 2008-02-17. the code no longer relies on the funcsynopsis.tabular.threshold -->
220 <!-- * param at all (the stuff below has been commented out since mid -->
221 <!-- * 2006), so I completely removed the funcsynopsis.tabular.threshold param -->
222 <!-- * .. MikeSmith -->
223 <!--
224   <xsl:variable name="tabular-p"
225                 select="$funcsynopsis.tabular.threshold &gt; 0
226                         and string-length(.) &gt; $funcsynopsis.tabular.threshold"/>
227 -->
228
229   <xsl:variable name="tabular-p" select="true()"/>
230
231   <xsl:choose>
232     <xsl:when test="$style = 'kr' and $tabular-p">
233       <xsl:apply-templates select="." mode="kr-tabular"/>
234     </xsl:when>
235     <xsl:when test="$style = 'kr'">
236       <xsl:apply-templates select="." mode="kr-nontabular"/>
237     </xsl:when>
238     <xsl:when test="$style = 'ansi' and $tabular-p">
239       <xsl:apply-templates select="." mode="ansi-tabular"/>
240     </xsl:when>
241     <xsl:otherwise>
242       <xsl:apply-templates select="." mode="ansi-nontabular"/>
243     </xsl:otherwise>
244   </xsl:choose>
245 </xsl:template>
246
247 <!-- ====================================================================== -->
248 <!-- funcprototype: kr, non-tabular -->
249
250 <xsl:template match="funcprototype" mode="kr-nontabular">
251   <p>
252     <xsl:apply-templates mode="kr-nontabular"/>
253     <xsl:if test="paramdef">
254       <br/>
255       <xsl:apply-templates select="paramdef" mode="kr-funcsynopsis-mode"/>
256     </xsl:if>
257   </p>
258 </xsl:template>
259
260 <xsl:template match="funcdef" mode="kr-nontabular">
261   <code>
262     <xsl:apply-templates select="." mode="common.html.attributes"/>
263     <xsl:apply-templates mode="kr-nontabular"/>
264     <xsl:text>(</xsl:text>
265   </code>
266 </xsl:template>
267
268 <xsl:template match="funcdef/function" mode="kr-nontabular">
269   <xsl:choose>
270     <xsl:when test="$funcsynopsis.decoration != 0">
271       <b class="fsfunc"><xsl:apply-templates mode="kr-nontabular"/></b>
272     </xsl:when>
273     <xsl:otherwise>
274       <xsl:apply-templates mode="kr-nontabular"/>
275     </xsl:otherwise>
276   </xsl:choose>
277 </xsl:template>
278
279 <xsl:template match="void" mode="kr-nontabular">
280   <code>)</code>
281   <xsl:text>;</xsl:text>
282 </xsl:template>
283
284 <xsl:template match="varargs" mode="kr-nontabular">
285   <xsl:text>...</xsl:text>
286   <code>)</code>
287   <xsl:text>;</xsl:text>
288 </xsl:template>
289
290 <xsl:template match="paramdef" mode="kr-nontabular">
291   <xsl:apply-templates select="parameter" mode="kr-nontabular"/>
292   <xsl:choose>
293     <xsl:when test="following-sibling::*">
294       <xsl:text>, </xsl:text>
295     </xsl:when>
296     <xsl:otherwise>
297       <code>)</code>
298       <xsl:text>;</xsl:text>
299     </xsl:otherwise>
300   </xsl:choose>
301 </xsl:template>
302
303 <xsl:template match="paramdef/parameter" mode="kr-nontabular">
304   <xsl:choose>
305     <xsl:when test="$funcsynopsis.decoration != 0">
306       <var class="pdparam">
307         <xsl:apply-templates mode="kr-nontabular"/>
308       </var>
309     </xsl:when>
310     <xsl:otherwise>
311       <code>
312         <xsl:apply-templates mode="kr-nontabular"/>
313       </code>
314     </xsl:otherwise>
315   </xsl:choose>
316 </xsl:template>
317
318 <xsl:template match="paramdef" mode="kr-funcsynopsis-mode">
319   <xsl:if test="preceding-sibling::paramdef"><br/></xsl:if>
320   <code>
321     <xsl:apply-templates mode="kr-funcsynopsis-mode"/>
322   </code>
323   <xsl:text>;</xsl:text>
324 </xsl:template>
325
326 <xsl:template match="paramdef/parameter" mode="kr-funcsynopsis-mode">
327   <xsl:choose>
328     <xsl:when test="$funcsynopsis.decoration != 0">
329       <var class="pdparam">
330         <xsl:apply-templates mode="kr-funcsynopsis-mode"/>
331       </var>
332     </xsl:when>
333     <xsl:otherwise>
334       <code>
335         <xsl:apply-templates mode="kr-funcsynopsis-mode"/>
336       </code>
337     </xsl:otherwise>
338   </xsl:choose>
339 </xsl:template>
340
341 <xsl:template match="funcparams" mode="kr-funcsynopsis-mode">
342   <code>(</code>
343   <xsl:apply-templates mode="kr-funcsynopsis-mode"/>
344   <code>)</code>
345 </xsl:template>
346
347 <!-- ====================================================================== -->
348 <!-- funcprototype: kr, tabular -->
349
350 <xsl:template match="funcprototype" mode="kr-tabular">
351   <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table">
352     <tr>
353       <td>
354         <xsl:apply-templates select="funcdef" mode="kr-tabular"/>
355       </td>
356       <xsl:apply-templates select="(void|varargs|paramdef)[1]" mode="kr-tabular"/>
357     </tr>
358     <xsl:for-each select="(void|varargs|paramdef)[preceding-sibling::*[not(self::funcdef)]]">
359       <tr>
360         <td>&#160;</td>
361         <xsl:apply-templates select="." mode="kr-tabular"/>
362       </tr>
363     </xsl:for-each>
364   </table>
365   <xsl:if test="paramdef">
366     <div class="paramdef-list">
367       <xsl:apply-templates select="paramdef" mode="kr-funcsynopsis-mode"/>
368     </div>
369   </xsl:if>
370   <div class="funcprototype-spacer">&#160;</div> <!-- hACk: blank div for vertical spacing -->
371 </xsl:template>
372
373 <xsl:template match="funcdef" mode="kr-tabular">
374   <code>
375     <xsl:apply-templates select="." mode="common.html.attributes"/>
376     <xsl:apply-templates mode="kr-tabular"/>
377     <xsl:text>(</xsl:text>
378   </code>
379 </xsl:template>
380
381 <xsl:template match="funcdef/function" mode="kr-tabular">
382   <xsl:choose>
383     <xsl:when test="$funcsynopsis.decoration != 0">
384       <b class="fsfunc"><xsl:apply-templates mode="kr-nontabular"/></b>
385     </xsl:when>
386     <xsl:otherwise>
387       <xsl:apply-templates mode="kr-tabular"/>
388     </xsl:otherwise>
389   </xsl:choose>
390 </xsl:template>
391
392 <xsl:template match="void" mode="kr-tabular">
393   <td>
394     <code>)</code>
395     <xsl:text>;</xsl:text>
396   </td>
397   <td>&#160;</td>
398 </xsl:template>
399
400 <xsl:template match="varargs" mode="kr-tabular">
401   <td>
402     <xsl:text>...</xsl:text>
403     <code>)</code>
404     <xsl:text>;</xsl:text>
405   </td>
406   <td>&#160;</td>
407 </xsl:template>
408
409 <xsl:template match="paramdef" mode="kr-tabular">
410   <td>
411     <xsl:apply-templates select="parameter" mode="kr-tabular"/>
412     <xsl:choose>
413       <xsl:when test="following-sibling::*">
414         <xsl:text>, </xsl:text>
415       </xsl:when>
416       <xsl:otherwise>
417         <code>)</code>
418         <xsl:text>;</xsl:text>
419       </xsl:otherwise>
420     </xsl:choose>
421   </td>
422   <td>&#160;</td>
423 </xsl:template>
424
425 <xsl:template match="paramdef/parameter" mode="kr-tabular">
426   <xsl:choose>
427     <xsl:when test="$funcsynopsis.decoration != 0">
428       <var class="pdparam">
429         <xsl:apply-templates mode="kr-tabular"/>
430       </var>
431     </xsl:when>
432     <xsl:otherwise>
433       <code>
434         <xsl:apply-templates mode="kr-tabular"/>
435       </code>
436     </xsl:otherwise>
437   </xsl:choose>
438 </xsl:template>
439
440 <xsl:template match="paramdef" mode="kr-tabular-funcsynopsis-mode">
441   <xsl:variable name="type">
442     <xsl:choose>
443       <xsl:when test="type">
444         <xsl:apply-templates select="type" mode="kr-tabular-funcsynopsis-mode"/>
445       </xsl:when>
446       <xsl:when test="normalize-space(parameter/preceding-sibling::node()[not(self::parameter)]) != ''">
447         <xsl:copy-of select="parameter/preceding-sibling::node()[not(self::parameter)]"/>
448       </xsl:when>
449     </xsl:choose>
450   </xsl:variable>
451
452   <tr>
453     <xsl:choose>
454       <xsl:when test="$type != '' and funcparams">
455         <td>
456           <code>
457             <xsl:copy-of select="$type"/>
458           </code>
459           <xsl:text>&#160;</xsl:text>
460         </td>
461         <td>
462           <code>
463             <xsl:choose>
464               <xsl:when test="type">
465                 <xsl:apply-templates select="type/following-sibling::*" mode="kr-tabular-funcsynopsis-mode"/>
466               </xsl:when>
467               <xsl:otherwise>
468                 <xsl:apply-templates select="*" mode="kr-tabular-funcsynopsis-mode"/>
469               </xsl:otherwise>
470             </xsl:choose>
471           </code>
472         </td>
473       </xsl:when>
474
475       <xsl:when test="funcparams">
476         <td colspan="2">
477           <code>
478             <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/>
479           </code>
480         </td>
481       </xsl:when>
482
483       <xsl:otherwise>
484         <td>
485           <code>
486             <xsl:apply-templates select="parameter/preceding-sibling::node()[not(self::parameter)]" mode="kr-tabular-funcsynopsis-mode"/>
487           </code>
488           <xsl:text>&#160;</xsl:text>
489         </td>
490         <td>
491           <code>
492             <xsl:apply-templates select="parameter" mode="kr-tabular"/>
493             <xsl:apply-templates select="parameter/following-sibling::*[not(self::parameter)]" mode="kr-tabular-funcsynopsis-mode"/>
494             <xsl:text>;</xsl:text>
495           </code>
496         </td>
497       </xsl:otherwise>
498     </xsl:choose>
499   </tr>
500 </xsl:template>
501
502 <xsl:template match="paramdef/parameter" mode="kr-tabular-funcsynopsis-mode">
503   <xsl:choose>
504     <xsl:when test="$funcsynopsis.decoration != 0">
505       <var class="pdparam">
506         <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/>
507       </var>
508     </xsl:when>
509     <xsl:otherwise>
510       <code>
511         <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/>
512       </code>
513     </xsl:otherwise>
514   </xsl:choose>
515 </xsl:template>
516
517 <xsl:template match="funcparams" mode="kr-tabular-funcsynopsis-mode">
518   <code>(</code>
519   <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/>
520   <code>)</code>
521   <xsl:text>;</xsl:text>
522 </xsl:template>
523
524 <!-- ====================================================================== -->
525 <!-- funcprototype: ansi, non-tabular -->
526
527 <xsl:template match="funcprototype" mode="ansi-nontabular">
528   <p>
529     <xsl:apply-templates mode="ansi-nontabular"/>
530   </p>
531 </xsl:template>
532
533 <xsl:template match="funcdef" mode="ansi-nontabular">
534   <code>
535     <xsl:apply-templates select="." mode="common.html.attributes"/>
536     <xsl:apply-templates mode="ansi-nontabular"/>
537     <xsl:text>(</xsl:text>
538   </code>
539 </xsl:template>
540
541 <xsl:template match="funcdef/function" mode="ansi-nontabular">
542   <xsl:choose>
543     <xsl:when test="$funcsynopsis.decoration != 0">
544       <b class="fsfunc"><xsl:apply-templates mode="ansi-nontabular"/></b>
545     </xsl:when>
546     <xsl:otherwise>
547       <xsl:apply-templates mode="ansi-nontabular"/>
548     </xsl:otherwise>
549   </xsl:choose>
550 </xsl:template>
551
552 <xsl:template match="void" mode="ansi-nontabular">
553   <code>void)</code>
554   <xsl:text>;</xsl:text>
555 </xsl:template>
556
557 <xsl:template match="varargs" mode="ansi-nontabular">
558   <xsl:text>...</xsl:text>
559   <code>)</code>
560   <xsl:text>;</xsl:text>
561 </xsl:template>
562
563 <xsl:template match="paramdef" mode="ansi-nontabular">
564   <xsl:apply-templates mode="ansi-nontabular"/>
565   <xsl:choose>
566     <xsl:when test="following-sibling::*">
567       <xsl:text>, </xsl:text>
568     </xsl:when>
569     <xsl:otherwise>
570       <code>)</code>
571       <xsl:text>;</xsl:text>
572     </xsl:otherwise>
573   </xsl:choose>
574 </xsl:template>
575
576 <xsl:template match="paramdef/parameter" mode="ansi-nontabular">
577   <xsl:choose>
578     <xsl:when test="$funcsynopsis.decoration != 0">
579       <var class="pdparam">
580         <xsl:apply-templates mode="ansi-nontabular"/>
581       </var>
582     </xsl:when>
583     <xsl:otherwise>
584       <code>
585         <xsl:apply-templates mode="ansi-nontabular"/>
586       </code>
587     </xsl:otherwise>
588   </xsl:choose>
589 </xsl:template>
590
591 <xsl:template match="funcparams" mode="ansi-nontabular">
592   <code>(</code>
593   <xsl:apply-templates mode="ansi-nontabular"/>
594   <code>)</code>
595 </xsl:template>
596
597 <!-- ====================================================================== -->
598 <!-- funcprototype: ansi, tabular -->
599
600 <xsl:template match="funcprototype" mode="ansi-tabular">
601   <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table">
602     <tr>
603       <td>
604         <xsl:apply-templates select="funcdef" mode="ansi-tabular"/>
605       </td>
606       <xsl:apply-templates select="(void|varargs|paramdef)[1]" mode="ansi-tabular"/>
607     </tr>
608     <xsl:for-each select="(void|varargs|paramdef)[preceding-sibling::*[not(self::funcdef)]]">
609       <tr>
610         <td>&#160;</td>
611         <xsl:apply-templates select="." mode="ansi-tabular"/>
612       </tr>
613     </xsl:for-each>
614   </table>
615   <div class="funcprototype-spacer">&#160;</div> <!-- hACk: blank div for vertical spacing -->
616 </xsl:template>
617
618 <xsl:template match="funcdef" mode="ansi-tabular">
619   <code>
620     <xsl:apply-templates select="." mode="common.html.attributes"/>
621     <xsl:apply-templates mode="ansi-tabular"/>
622     <xsl:text>(</xsl:text>
623   </code>
624 </xsl:template>
625
626 <xsl:template match="funcdef/function" mode="ansi-tabular">
627   <xsl:choose>
628     <xsl:when test="$funcsynopsis.decoration != 0">
629       <b class="fsfunc"><xsl:apply-templates mode="ansi-nontabular"/></b>
630     </xsl:when>
631     <xsl:otherwise>
632       <xsl:apply-templates mode="kr-tabular"/>
633     </xsl:otherwise>
634   </xsl:choose>
635 </xsl:template>
636
637 <xsl:template match="void" mode="ansi-tabular">
638   <td>
639     <code>void)</code>
640     <xsl:text>;</xsl:text>
641   </td>
642   <td>&#160;</td>
643 </xsl:template>
644
645 <xsl:template match="varargs" mode="ansi-tabular">
646   <td>
647     <xsl:text>...</xsl:text>
648     <code>)</code>
649     <xsl:text>;</xsl:text>
650   </td>
651   <td>&#160;</td>
652 </xsl:template>
653
654 <xsl:template match="paramdef" mode="ansi-tabular">
655       <td>
656         <xsl:apply-templates mode="ansi-tabular"/>
657         <xsl:choose>
658           <xsl:when test="following-sibling::*">
659             <xsl:text>, </xsl:text>
660           </xsl:when>
661           <xsl:otherwise>
662             <code>)</code>
663             <xsl:text>;</xsl:text>
664           </xsl:otherwise>
665         </xsl:choose>
666       </td>
667 </xsl:template>
668
669 <xsl:template match="paramdef/parameter" mode="ansi-tabular">
670   <xsl:choose>
671     <xsl:when test="$funcsynopsis.decoration != 0">
672       <var class="pdparam">
673         <xsl:apply-templates mode="ansi-tabular"/>
674       </var>
675     </xsl:when>
676     <xsl:otherwise>
677       <code>
678         <xsl:apply-templates mode="ansi-tabular"/>
679       </code>
680     </xsl:otherwise>
681   </xsl:choose>
682 </xsl:template>
683
684 <xsl:template match="funcparams" mode="ansi-tabular">
685   <code>(</code>
686   <xsl:apply-templates/>
687   <code>)</code>
688 </xsl:template>
689
690 <!-- ====================================================================== -->
691
692 <xsl:variable name="default-classsynopsis-language">java</xsl:variable>
693
694 <xsl:template match="classsynopsis                      |fieldsynopsis                      |methodsynopsis                      |constructorsynopsis                      |destructorsynopsis">
695   <xsl:param name="language">
696     <xsl:choose>
697       <xsl:when test="@language">
698         <xsl:value-of select="@language"/>
699       </xsl:when>
700       <xsl:otherwise>
701         <xsl:value-of select="$default-classsynopsis-language"/>
702       </xsl:otherwise>
703     </xsl:choose>
704   </xsl:param>
705
706   <xsl:choose>
707     <xsl:when test="$language='java' or $language='Java'">
708       <xsl:apply-templates select="." mode="java"/>
709     </xsl:when>
710     <xsl:when test="$language='perl' or $language='Perl'">
711       <xsl:apply-templates select="." mode="perl"/>
712     </xsl:when>
713     <xsl:when test="$language='idl' or $language='IDL'">
714       <xsl:apply-templates select="." mode="idl"/>
715     </xsl:when>
716     <xsl:when test="$language='cpp' or $language='c++' or $language='C++'">
717       <xsl:apply-templates select="." mode="cpp"/>
718     </xsl:when>
719     <xsl:otherwise>
720       <xsl:message>
721         <xsl:text>Unrecognized language on </xsl:text>
722         <xsl:value-of select="local-name(.)"/>
723         <xsl:text>: </xsl:text>
724         <xsl:value-of select="$language"/>
725       </xsl:message>
726       <xsl:apply-templates select=".">
727         <xsl:with-param name="language" select="$default-classsynopsis-language"/>
728       </xsl:apply-templates>
729     </xsl:otherwise>
730   </xsl:choose>
731 </xsl:template>
732
733 <xsl:template name="synop-break">
734   <xsl:if test="parent::classsynopsis                 or (following-sibling::fieldsynopsis                     |following-sibling::methodsynopsis                     |following-sibling::constructorsynopsis                     |following-sibling::destructorsynopsis)">
735     <br/>
736   </xsl:if>
737 </xsl:template>
738
739
740 <!-- ===== Java ======================================================== -->
741
742 <xsl:template match="classsynopsis" mode="java">
743   <pre>
744     <xsl:apply-templates select="." mode="common.html.attributes"/>
745     <xsl:apply-templates select="ooclass[1]" mode="java"/>
746     <xsl:if test="ooclass[preceding-sibling::*]">
747       <xsl:text> extends</xsl:text>
748       <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="java"/>
749       <xsl:if test="oointerface|ooexception">
750         <br/>
751         <xsl:text>&#160;&#160;&#160;&#160;</xsl:text>
752       </xsl:if>
753     </xsl:if>
754     <xsl:if test="oointerface">
755       <xsl:text>implements</xsl:text>
756       <xsl:apply-templates select="oointerface" mode="java"/>
757       <xsl:if test="ooexception">
758         <br/>
759         <xsl:text>&#160;&#160;&#160;&#160;</xsl:text>
760       </xsl:if>
761     </xsl:if>
762     <xsl:if test="ooexception">
763       <xsl:text>throws</xsl:text>
764       <xsl:apply-templates select="ooexception" mode="java"/>
765     </xsl:if>
766     <xsl:text>&#160;{</xsl:text>
767     <br/>
768     <xsl:apply-templates select="constructorsynopsis                                  |destructorsynopsis                                  |fieldsynopsis                                  |methodsynopsis                                  |classsynopsisinfo" mode="java"/>
769     <xsl:text>}</xsl:text>
770   </pre>
771 </xsl:template>
772
773 <xsl:template match="classsynopsisinfo" mode="java">
774   <xsl:apply-templates mode="java"/>
775 </xsl:template>
776
777 <xsl:template match="ooclass|oointerface|ooexception" mode="java">
778   <xsl:choose>
779     <xsl:when test="preceding-sibling::*">
780       <xsl:text>, </xsl:text>
781     </xsl:when>
782     <xsl:otherwise>
783       <xsl:text> </xsl:text>
784     </xsl:otherwise>
785   </xsl:choose>
786   <span>
787     <xsl:apply-templates select="." mode="common.html.attributes"/>
788     <xsl:apply-templates mode="java"/>
789   </span>
790 </xsl:template>
791
792 <xsl:template match="modifier|package" mode="java">
793   <span>
794     <xsl:apply-templates select="." mode="common.html.attributes"/>
795     <xsl:apply-templates mode="java"/>
796     <xsl:if test="following-sibling::*">
797       <xsl:text>&#160;</xsl:text>
798     </xsl:if>
799   </span>
800 </xsl:template>
801
802 <xsl:template match="classname" mode="java">
803   <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
804     <xsl:text>, </xsl:text>
805   </xsl:if>
806   <span>
807     <xsl:apply-templates select="." mode="common.html.attributes"/>
808     <xsl:apply-templates mode="java"/>
809   </span>
810 </xsl:template>
811
812 <xsl:template match="interfacename" mode="java">
813   <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
814     <xsl:text>, </xsl:text>
815   </xsl:if>
816   <span>
817     <xsl:apply-templates select="." mode="common.html.attributes"/>
818     <xsl:apply-templates mode="java"/>
819   </span>
820 </xsl:template>
821
822 <xsl:template match="exceptionname" mode="java">
823   <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
824     <xsl:text>, </xsl:text>
825   </xsl:if>
826   <span>
827     <xsl:apply-templates select="." mode="common.html.attributes"/>
828     <xsl:apply-templates mode="java"/>
829   </span>
830 </xsl:template>
831
832 <xsl:template match="fieldsynopsis" mode="java">
833   <code>
834     <xsl:apply-templates select="." mode="common.html.attributes"/>
835     <xsl:if test="parent::classsynopsis">
836       <xsl:text>&#160;&#160;</xsl:text>
837     </xsl:if>
838     <xsl:apply-templates mode="java"/>
839     <xsl:text>;</xsl:text>
840   </code>
841   <xsl:call-template name="synop-break"/>
842 </xsl:template>
843
844 <xsl:template match="type" mode="java">
845   <span>
846     <xsl:apply-templates select="." mode="common.html.attributes"/>
847     <xsl:apply-templates mode="java"/>
848     <xsl:text>&#160;</xsl:text>
849   </span>
850 </xsl:template>
851
852 <xsl:template match="varname" mode="java">
853   <span>
854     <xsl:apply-templates select="." mode="common.html.attributes"/>
855     <xsl:apply-templates mode="java"/>
856     <xsl:text>&#160;</xsl:text>
857   </span>
858 </xsl:template>
859
860 <xsl:template match="initializer" mode="java">
861   <span>
862     <xsl:apply-templates select="." mode="common.html.attributes"/>
863     <xsl:text>=&#160;</xsl:text>
864     <xsl:apply-templates mode="java"/>
865   </span>
866 </xsl:template>
867
868 <xsl:template match="void" mode="java">
869   <span>
870     <xsl:apply-templates select="." mode="common.html.attributes"/>
871     <xsl:text>void&#160;</xsl:text>
872   </span>
873 </xsl:template>
874
875 <xsl:template match="methodname" mode="java">
876   <span>
877     <xsl:apply-templates select="." mode="common.html.attributes"/>
878     <xsl:apply-templates mode="java"/>
879   </span>
880 </xsl:template>
881
882 <xsl:template match="methodparam" mode="java">
883   <xsl:param name="indent">0</xsl:param>
884   <xsl:if test="preceding-sibling::methodparam">
885     <xsl:text>,</xsl:text>
886     <br/>
887     <xsl:if test="$indent &gt; 0">
888       <xsl:call-template name="copy-string">
889         <xsl:with-param name="string">&#160;</xsl:with-param>
890         <xsl:with-param name="count" select="$indent + 1"/>
891       </xsl:call-template>
892     </xsl:if>
893   </xsl:if>
894   <span>
895     <xsl:apply-templates select="." mode="common.html.attributes"/>
896     <xsl:apply-templates mode="java"/>
897   </span>
898 </xsl:template>
899
900 <xsl:template match="parameter" mode="java">
901   <span>
902     <xsl:apply-templates select="." mode="common.html.attributes"/>
903     <xsl:apply-templates mode="java"/>
904   </span>
905 </xsl:template>
906
907 <xsl:template mode="java" match="constructorsynopsis|destructorsynopsis|methodsynopsis">
908   <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
909   <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
910   <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
911   <xsl:variable name="decl">
912     <xsl:if test="parent::classsynopsis">
913       <xsl:text>&#160;&#160;</xsl:text>
914     </xsl:if>
915     <xsl:apply-templates select="$start-modifiers" mode="java"/>
916
917     <!-- type -->
918     <xsl:if test="local-name($notmod[1]) != 'methodname'">
919       <xsl:apply-templates select="$notmod[1]" mode="java"/>
920     </xsl:if>
921
922     <xsl:apply-templates select="methodname" mode="java"/>
923   </xsl:variable>
924
925   <code>
926     <xsl:apply-templates select="." mode="common.html.attributes"/>
927     <xsl:copy-of select="$decl"/>
928     <xsl:text>(</xsl:text>
929     <xsl:apply-templates select="methodparam" mode="java">
930       <xsl:with-param name="indent" select="string-length($decl)"/>
931     </xsl:apply-templates>
932     <xsl:text>)</xsl:text>
933     <xsl:if test="exceptionname">
934       <br/>
935       <xsl:text>&#160;&#160;&#160;&#160;throws&#160;</xsl:text>
936       <xsl:apply-templates select="exceptionname" mode="java"/>
937     </xsl:if>
938     <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
939       <xsl:text> </xsl:text>
940       <xsl:apply-templates select="$end-modifiers" mode="java"/>
941     </xsl:if>
942     <xsl:text>;</xsl:text>
943   </code>
944   <xsl:call-template name="synop-break"/>
945 </xsl:template>
946
947 <!-- ===== C++ ========================================================= -->
948
949 <xsl:template match="classsynopsis" mode="cpp">
950   <pre>
951     <xsl:apply-templates select="." mode="common.html.attributes"/>
952     <xsl:apply-templates select="ooclass[1]" mode="cpp"/>
953     <xsl:if test="ooclass[preceding-sibling::*]">
954       <xsl:text>: </xsl:text>
955       <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="cpp"/>
956       <xsl:if test="oointerface|ooexception">
957         <br/>
958         <xsl:text>&#160;&#160;&#160;&#160;</xsl:text>
959       </xsl:if>
960     </xsl:if>
961     <xsl:if test="oointerface">
962       <xsl:text> implements</xsl:text>
963       <xsl:apply-templates select="oointerface" mode="cpp"/>
964       <xsl:if test="ooexception">
965         <br/>
966         <xsl:text>&#160;&#160;&#160;&#160;</xsl:text>
967       </xsl:if>
968     </xsl:if>
969     <xsl:if test="ooexception">
970       <xsl:text> throws</xsl:text>
971       <xsl:apply-templates select="ooexception" mode="cpp"/>
972     </xsl:if>
973     <xsl:text>&#160;{</xsl:text>
974     <br/>
975     <xsl:apply-templates select="constructorsynopsis                                  |destructorsynopsis                                  |fieldsynopsis                                  |methodsynopsis                                  |classsynopsisinfo" mode="cpp"/>
976     <xsl:text>}</xsl:text>
977   </pre>
978 </xsl:template>
979
980 <xsl:template match="classsynopsisinfo" mode="cpp">
981   <xsl:apply-templates mode="cpp"/>
982 </xsl:template>
983
984 <xsl:template match="ooclass|oointerface|ooexception" mode="cpp">
985   <xsl:if test="preceding-sibling::*">
986     <xsl:text>, </xsl:text>
987   </xsl:if>
988   <span>
989     <xsl:apply-templates select="." mode="common.html.attributes"/>
990     <xsl:apply-templates mode="cpp"/>
991   </span>
992 </xsl:template>
993
994 <xsl:template match="modifier|package" mode="cpp">
995   <span>
996     <xsl:apply-templates select="." mode="common.html.attributes"/>
997     <xsl:apply-templates mode="cpp"/>
998     <xsl:if test="following-sibling::*">
999       <xsl:text>&#160;</xsl:text>
1000     </xsl:if>
1001   </span>
1002 </xsl:template>
1003
1004 <xsl:template match="classname" mode="cpp">
1005   <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
1006     <xsl:text>, </xsl:text>
1007   </xsl:if>
1008   <span>
1009     <xsl:apply-templates select="." mode="common.html.attributes"/>
1010     <xsl:apply-templates mode="cpp"/>
1011   </span>
1012 </xsl:template>
1013
1014 <xsl:template match="interfacename" mode="cpp">
1015   <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
1016     <xsl:text>, </xsl:text>
1017   </xsl:if>
1018   <span>
1019     <xsl:apply-templates select="." mode="common.html.attributes"/>
1020     <xsl:apply-templates mode="cpp"/>
1021   </span>
1022 </xsl:template>
1023
1024 <xsl:template match="exceptionname" mode="cpp">
1025   <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
1026     <xsl:text>, </xsl:text>
1027   </xsl:if>
1028   <span>
1029     <xsl:apply-templates select="." mode="common.html.attributes"/>
1030     <xsl:apply-templates mode="cpp"/>
1031   </span>
1032 </xsl:template>
1033
1034 <xsl:template match="fieldsynopsis" mode="cpp">
1035   <code>
1036     <xsl:apply-templates select="." mode="common.html.attributes"/>
1037     <xsl:if test="parent::classsynopsis">
1038       <xsl:text>&#160;&#160;</xsl:text>
1039     </xsl:if>
1040     <xsl:apply-templates mode="cpp"/>
1041     <xsl:text>;</xsl:text>
1042   </code>
1043   <xsl:call-template name="synop-break"/>
1044 </xsl:template>
1045
1046 <xsl:template match="type" mode="cpp">
1047   <span>
1048     <xsl:apply-templates select="." mode="common.html.attributes"/>
1049     <xsl:apply-templates mode="cpp"/>
1050     <xsl:text>&#160;</xsl:text>
1051   </span>
1052 </xsl:template>
1053
1054 <xsl:template match="varname" mode="cpp">
1055   <span>
1056     <xsl:apply-templates select="." mode="common.html.attributes"/>
1057     <xsl:apply-templates mode="cpp"/>
1058     <xsl:text>&#160;</xsl:text>
1059   </span>
1060 </xsl:template>
1061
1062 <xsl:template match="initializer" mode="cpp">
1063   <span>
1064     <xsl:apply-templates select="." mode="common.html.attributes"/>
1065     <xsl:text>=&#160;</xsl:text>
1066     <xsl:apply-templates mode="cpp"/>
1067   </span>
1068 </xsl:template>
1069
1070 <xsl:template match="void" mode="cpp">
1071   <span>
1072     <xsl:apply-templates select="." mode="common.html.attributes"/>
1073     <xsl:text>void&#160;</xsl:text>
1074   </span>
1075 </xsl:template>
1076
1077 <xsl:template match="methodname" mode="cpp">
1078   <span>
1079     <xsl:apply-templates select="." mode="common.html.attributes"/>
1080     <xsl:apply-templates mode="cpp"/>
1081   </span>
1082 </xsl:template>
1083
1084 <xsl:template match="methodparam" mode="cpp">
1085   <xsl:if test="preceding-sibling::methodparam">
1086     <xsl:text>, </xsl:text>
1087   </xsl:if>
1088   <span>
1089     <xsl:apply-templates select="." mode="common.html.attributes"/>
1090     <xsl:apply-templates mode="cpp"/>
1091   </span>
1092 </xsl:template>
1093
1094 <xsl:template match="parameter" mode="cpp">
1095   <span>
1096     <xsl:apply-templates select="." mode="common.html.attributes"/>
1097     <xsl:apply-templates mode="cpp"/>
1098   </span>
1099 </xsl:template>
1100
1101 <xsl:template mode="cpp" match="constructorsynopsis|destructorsynopsis|methodsynopsis">
1102   <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
1103   <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
1104   <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
1105
1106   <code>
1107     <xsl:apply-templates select="." mode="common.html.attributes"/>
1108     <xsl:if test="parent::classsynopsis">
1109       <xsl:text>&#160;&#160;</xsl:text>
1110     </xsl:if>
1111     <xsl:apply-templates select="$start-modifiers" mode="cpp"/>
1112
1113     <!-- type -->
1114     <xsl:if test="local-name($notmod[1]) != 'methodname'">
1115       <xsl:apply-templates select="$notmod[1]" mode="cpp"/>
1116     </xsl:if>
1117
1118     <xsl:apply-templates select="methodname" mode="cpp"/>
1119     <xsl:text>(</xsl:text>
1120     <xsl:apply-templates select="methodparam" mode="cpp"/>
1121     <xsl:text>)</xsl:text>
1122     <xsl:if test="exceptionname">
1123       <br/>
1124       <xsl:text>&#160;&#160;&#160;&#160;throws&#160;</xsl:text>
1125       <xsl:apply-templates select="exceptionname" mode="cpp"/>
1126     </xsl:if>
1127     <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
1128       <xsl:text> </xsl:text>
1129       <xsl:apply-templates select="$end-modifiers" mode="cpp"/>
1130     </xsl:if>
1131     <xsl:text>;</xsl:text>
1132   </code>
1133   <xsl:call-template name="synop-break"/>
1134 </xsl:template>
1135
1136 <!-- ===== IDL ========================================================= -->
1137
1138 <xsl:template match="classsynopsis" mode="idl">
1139   <pre>
1140     <xsl:apply-templates select="." mode="common.html.attributes"/>
1141     <xsl:text>interface </xsl:text>
1142     <xsl:apply-templates select="ooclass[1]" mode="idl"/>
1143     <xsl:if test="ooclass[preceding-sibling::*]">
1144       <xsl:text>: </xsl:text>
1145       <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="idl"/>
1146       <xsl:if test="oointerface|ooexception">
1147         <br/>
1148         <xsl:text>&#160;&#160;&#160;&#160;</xsl:text>
1149       </xsl:if>
1150     </xsl:if>
1151     <xsl:if test="oointerface">
1152       <xsl:text> implements</xsl:text>
1153       <xsl:apply-templates select="oointerface" mode="idl"/>
1154       <xsl:if test="ooexception">
1155         <br/>
1156         <xsl:text>&#160;&#160;&#160;&#160;</xsl:text>
1157       </xsl:if>
1158     </xsl:if>
1159     <xsl:if test="ooexception">
1160       <xsl:text> throws</xsl:text>
1161       <xsl:apply-templates select="ooexception" mode="idl"/>
1162     </xsl:if>
1163     <xsl:text>&#160;{</xsl:text>
1164     <br/>
1165     <xsl:apply-templates select="constructorsynopsis                                  |destructorsynopsis                                  |fieldsynopsis                                  |methodsynopsis                                  |classsynopsisinfo" mode="idl"/>
1166     <xsl:text>}</xsl:text>
1167   </pre>
1168 </xsl:template>
1169
1170 <xsl:template match="classsynopsisinfo" mode="idl">
1171   <xsl:apply-templates mode="idl"/>
1172 </xsl:template>
1173
1174 <xsl:template match="ooclass|oointerface|ooexception" mode="idl">
1175   <xsl:if test="preceding-sibling::*">
1176     <xsl:text>, </xsl:text>
1177   </xsl:if>
1178   <span>
1179     <xsl:apply-templates select="." mode="common.html.attributes"/>
1180     <xsl:apply-templates mode="idl"/>
1181   </span>
1182 </xsl:template>
1183
1184 <xsl:template match="modifier|package" mode="idl">
1185   <span>
1186     <xsl:apply-templates select="." mode="common.html.attributes"/>
1187     <xsl:apply-templates mode="idl"/>
1188     <xsl:if test="following-sibling::*">
1189       <xsl:text>&#160;</xsl:text>
1190     </xsl:if>
1191   </span>
1192 </xsl:template>
1193
1194 <xsl:template match="classname" mode="idl">
1195   <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
1196     <xsl:text>, </xsl:text>
1197   </xsl:if>
1198   <span>
1199     <xsl:apply-templates select="." mode="common.html.attributes"/>
1200     <xsl:apply-templates mode="idl"/>
1201   </span>
1202 </xsl:template>
1203
1204 <xsl:template match="interfacename" mode="idl">
1205   <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
1206     <xsl:text>, </xsl:text>
1207   </xsl:if>
1208   <span>
1209     <xsl:apply-templates select="." mode="common.html.attributes"/>
1210     <xsl:apply-templates mode="idl"/>
1211   </span>
1212 </xsl:template>
1213
1214 <xsl:template match="exceptionname" mode="idl">
1215   <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
1216     <xsl:text>, </xsl:text>
1217   </xsl:if>
1218   <span>
1219     <xsl:apply-templates select="." mode="common.html.attributes"/>
1220     <xsl:apply-templates mode="idl"/>
1221   </span>
1222 </xsl:template>
1223
1224 <xsl:template match="fieldsynopsis" mode="idl">
1225   <code>
1226     <xsl:apply-templates select="." mode="common.html.attributes"/>
1227     <xsl:if test="parent::classsynopsis">
1228       <xsl:text>&#160;&#160;</xsl:text>
1229     </xsl:if>
1230     <xsl:apply-templates mode="idl"/>
1231     <xsl:text>;</xsl:text>
1232   </code>
1233   <xsl:call-template name="synop-break"/>
1234 </xsl:template>
1235
1236 <xsl:template match="type" mode="idl">
1237   <span>
1238     <xsl:apply-templates select="." mode="common.html.attributes"/>
1239     <xsl:apply-templates mode="idl"/>
1240     <xsl:text>&#160;</xsl:text>
1241   </span>
1242 </xsl:template>
1243
1244 <xsl:template match="varname" mode="idl">
1245   <span>
1246     <xsl:apply-templates select="." mode="common.html.attributes"/>
1247     <xsl:apply-templates mode="idl"/>
1248     <xsl:text>&#160;</xsl:text>
1249   </span>
1250 </xsl:template>
1251
1252 <xsl:template match="initializer" mode="idl">
1253   <span>
1254     <xsl:apply-templates select="." mode="common.html.attributes"/>
1255     <xsl:text>=&#160;</xsl:text>
1256     <xsl:apply-templates mode="idl"/>
1257   </span>
1258 </xsl:template>
1259
1260 <xsl:template match="void" mode="idl">
1261   <span>
1262     <xsl:apply-templates select="." mode="common.html.attributes"/>
1263     <xsl:text>void&#160;</xsl:text>
1264   </span>
1265 </xsl:template>
1266
1267 <xsl:template match="methodname" mode="idl">
1268   <span>
1269     <xsl:apply-templates select="." mode="common.html.attributes"/>
1270     <xsl:apply-templates mode="idl"/>
1271   </span>
1272 </xsl:template>
1273
1274 <xsl:template match="methodparam" mode="idl">
1275   <xsl:if test="preceding-sibling::methodparam">
1276     <xsl:text>, </xsl:text>
1277   </xsl:if>
1278   <span>
1279     <xsl:apply-templates select="." mode="common.html.attributes"/>
1280     <xsl:apply-templates mode="idl"/>
1281   </span>
1282 </xsl:template>
1283
1284 <xsl:template match="parameter" mode="idl">
1285   <span>
1286     <xsl:apply-templates select="." mode="common.html.attributes"/>
1287     <xsl:apply-templates mode="idl"/>
1288   </span>
1289 </xsl:template>
1290
1291 <xsl:template mode="idl" match="constructorsynopsis|destructorsynopsis|methodsynopsis">
1292   <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
1293   <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
1294   <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
1295   <code>
1296     <xsl:apply-templates select="." mode="common.html.attributes"/>
1297     <xsl:if test="parent::classsynopsis">
1298       <xsl:text>&#160;&#160;</xsl:text>
1299     </xsl:if>
1300     <xsl:apply-templates select="$start-modifiers" mode="idl"/>
1301
1302     <!-- type -->
1303     <xsl:if test="local-name($notmod[1]) != 'methodname'">
1304       <xsl:apply-templates select="$notmod[1]" mode="idl"/>
1305     </xsl:if>
1306
1307     <xsl:apply-templates select="methodname" mode="idl"/>
1308     <xsl:text>(</xsl:text>
1309     <xsl:apply-templates select="methodparam" mode="idl"/>
1310     <xsl:text>)</xsl:text>
1311     <xsl:if test="exceptionname">
1312       <br/>
1313       <xsl:text>&#160;&#160;&#160;&#160;raises(</xsl:text>
1314       <xsl:apply-templates select="exceptionname" mode="idl"/>
1315       <xsl:text>)</xsl:text>
1316     </xsl:if>
1317     <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
1318       <xsl:text> </xsl:text>
1319       <xsl:apply-templates select="$end-modifiers" mode="idl"/>
1320     </xsl:if>
1321     <xsl:text>;</xsl:text>
1322   </code>
1323   <xsl:call-template name="synop-break"/>
1324 </xsl:template>
1325
1326 <!-- ===== Perl ======================================================== -->
1327
1328 <xsl:template match="classsynopsis" mode="perl">
1329   <pre>
1330     <xsl:apply-templates select="." mode="common.html.attributes"/>
1331     <xsl:text>package </xsl:text>
1332     <xsl:apply-templates select="ooclass[1]" mode="perl"/>
1333     <xsl:text>;</xsl:text>
1334     <br/>
1335
1336     <xsl:if test="ooclass[preceding-sibling::*]">
1337       <xsl:text>@ISA = (</xsl:text>
1338       <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="perl"/>
1339       <xsl:text>);</xsl:text>
1340       <br/>
1341     </xsl:if>
1342
1343     <xsl:apply-templates select="constructorsynopsis                                  |destructorsynopsis                                  |fieldsynopsis                                  |methodsynopsis                                  |classsynopsisinfo" mode="perl"/>
1344   </pre>
1345 </xsl:template>
1346
1347 <xsl:template match="classsynopsisinfo" mode="perl">
1348   <xsl:apply-templates mode="perl"/>
1349 </xsl:template>
1350
1351 <xsl:template match="ooclass|oointerface|ooexception" mode="perl">
1352   <xsl:if test="preceding-sibling::*">
1353     <xsl:text>, </xsl:text>
1354   </xsl:if>
1355   <span>
1356     <xsl:apply-templates select="." mode="common.html.attributes"/>
1357     <xsl:apply-templates mode="perl"/>
1358   </span>
1359 </xsl:template>
1360
1361 <xsl:template match="modifier|package" mode="perl">
1362   <span>
1363     <xsl:apply-templates select="." mode="common.html.attributes"/>
1364     <xsl:apply-templates mode="perl"/>
1365     <xsl:if test="following-sibling::*">
1366       <xsl:text>&#160;</xsl:text>
1367     </xsl:if>
1368   </span>
1369 </xsl:template>
1370
1371 <xsl:template match="classname" mode="perl">
1372   <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
1373     <xsl:text>, </xsl:text>
1374   </xsl:if>
1375   <span>
1376     <xsl:apply-templates select="." mode="common.html.attributes"/>
1377     <xsl:apply-templates mode="perl"/>
1378   </span>
1379 </xsl:template>
1380
1381 <xsl:template match="interfacename" mode="perl">
1382   <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
1383     <xsl:text>, </xsl:text>
1384   </xsl:if>
1385   <span>
1386     <xsl:apply-templates select="." mode="common.html.attributes"/>
1387     <xsl:apply-templates mode="perl"/>
1388   </span>
1389 </xsl:template>
1390
1391 <xsl:template match="exceptionname" mode="perl">
1392   <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
1393     <xsl:text>, </xsl:text>
1394   </xsl:if>
1395   <span>
1396     <xsl:apply-templates select="." mode="common.html.attributes"/>
1397     <xsl:apply-templates mode="perl"/>
1398   </span>
1399 </xsl:template>
1400
1401 <xsl:template match="fieldsynopsis" mode="perl">
1402   <code>
1403     <xsl:apply-templates select="." mode="common.html.attributes"/>
1404     <xsl:if test="parent::classsynopsis">
1405       <xsl:text>&#160;&#160;</xsl:text>
1406     </xsl:if>
1407     <xsl:apply-templates mode="perl"/>
1408     <xsl:text>;</xsl:text>
1409   </code>
1410   <xsl:call-template name="synop-break"/>
1411 </xsl:template>
1412
1413 <xsl:template match="type" mode="perl">
1414   <span>
1415     <xsl:apply-templates select="." mode="common.html.attributes"/>
1416     <xsl:apply-templates mode="perl"/>
1417     <xsl:text>&#160;</xsl:text>
1418   </span>
1419 </xsl:template>
1420
1421 <xsl:template match="varname" mode="perl">
1422   <span>
1423     <xsl:apply-templates select="." mode="common.html.attributes"/>
1424     <xsl:apply-templates mode="perl"/>
1425     <xsl:text>&#160;</xsl:text>
1426   </span>
1427 </xsl:template>
1428
1429 <xsl:template match="initializer" mode="perl">
1430   <span>
1431     <xsl:apply-templates select="." mode="common.html.attributes"/>
1432     <xsl:text>=&#160;</xsl:text>
1433     <xsl:apply-templates mode="perl"/>
1434   </span>
1435 </xsl:template>
1436
1437 <xsl:template match="void" mode="perl">
1438   <span>
1439     <xsl:apply-templates select="." mode="common.html.attributes"/>
1440     <xsl:text>void&#160;</xsl:text>
1441   </span>
1442 </xsl:template>
1443
1444 <xsl:template match="methodname" mode="perl">
1445   <span>
1446     <xsl:apply-templates select="." mode="common.html.attributes"/>
1447     <xsl:apply-templates mode="perl"/>
1448   </span>
1449 </xsl:template>
1450
1451 <xsl:template match="methodparam" mode="perl">
1452   <xsl:if test="preceding-sibling::methodparam">
1453     <xsl:text>, </xsl:text>
1454   </xsl:if>
1455   <span>
1456     <xsl:apply-templates select="." mode="common.html.attributes"/>
1457     <xsl:apply-templates mode="perl"/>
1458   </span>
1459 </xsl:template>
1460
1461 <xsl:template match="parameter" mode="perl">
1462   <span>
1463     <xsl:apply-templates select="." mode="common.html.attributes"/>
1464     <xsl:apply-templates mode="perl"/>
1465   </span>
1466 </xsl:template>
1467
1468 <xsl:template mode="perl" match="constructorsynopsis|destructorsynopsis|methodsynopsis">
1469   <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
1470   <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
1471   <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
1472
1473   <code>
1474     <xsl:apply-templates select="." mode="common.html.attributes"/>
1475     <xsl:text>sub </xsl:text>
1476
1477     <xsl:apply-templates select="methodname" mode="perl"/>
1478     <xsl:text> { ... };</xsl:text>
1479   </code>
1480   <xsl:call-template name="synop-break"/>
1481 </xsl:template>
1482
1483 <!-- Used when not occurring as a child of classsynopsis -->
1484 <xsl:template match="ooclass|oointerface|ooexception">
1485   <xsl:apply-templates/>
1486 </xsl:template>
1487
1488 <!-- ==================================================================== -->
1489
1490 <!-- * DocBook 5 allows linking elements (link, olink, and xref) -->
1491 <!-- * within the OO *synopsis elements (classsynopsis, fieldsynopsis, -->
1492 <!-- * methodsynopsis, constructorsynopsis, destructorsynopsis) and -->
1493 <!-- * their children. So we need to have mode="java|cpp|idl|perl" -->
1494 <!-- * per-mode matches for those linking elements in order for them -->
1495 <!-- * to be processed as expected. -->
1496
1497 <xsl:template match="link|olink|xref" mode="java">
1498   <xsl:apply-templates select="."/>
1499 </xsl:template>
1500
1501 <xsl:template match="link|olink|xref" mode="cpp">
1502   <xsl:apply-templates select="."/>
1503 </xsl:template>
1504
1505 <xsl:template match="link|olink|xref" mode="idl">
1506   <xsl:apply-templates select="."/>
1507 </xsl:template>
1508
1509 <xsl:template match="link|olink|xref" mode="perl">
1510   <xsl:apply-templates select="."/>
1511 </xsl:template>
1512
1513 </xsl:stylesheet>