Debian Codegraph @

docs/xsl-generic/html/synop.xsl

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