source: stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/synop.xsl@ bbe9b3da

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since bbe9b3da was bbe9b3da, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Merged r8226 from new-xsl branch.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@6943 af4574ff-66df-0310-9fd7-8a98e5e911e0

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