source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml/synop.xsl@ 15c7d39

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 15c7d39 was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

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