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

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 de7d1c2f was aaab3da7, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Updated DocBook-XSL code to version 1.73.2

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

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