source: clfs-embedded/BOOK/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/synop.xsl @ 9882b55

Last change on this file since 9882b55 was 9882b55, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Added the new lfs-xsl stylesheets.

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