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">
6 <!-- ********************************************************************
7 $Id: synop.xsl 8421 2009-05-04 07:49:49Z bobstayton $
8 ********************************************************************
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.
14 ******************************************************************** -->
16 <!-- ==================================================================== -->
18 <!-- synopsis is in verbatim -->
20 <!-- ==================================================================== -->
22 <xsl:template match="cmdsynopsis">
24 <xsl:apply-templates select="." mode="common.html.attributes"/>
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"/>
37 <xsl:apply-templates/>
42 <xsl:template match="cmdsynopsis/command">
44 <xsl:call-template name="inline.monoseq"/>
45 <xsl:text> </xsl:text>
48 <xsl:template match="cmdsynopsis/command[1]" priority="2">
49 <xsl:call-template name="inline.monoseq"/>
50 <xsl:text> </xsl:text>
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">
58 <xsl:when test="ancestor-or-self::*/@sepchar">
59 <xsl:value-of select="ancestor-or-self::*/@sepchar"/>
62 <xsl:text> </xsl:text>
67 <xsl:if test="preceding-sibling::*">
68 <xsl:value-of select="$sepchar"/>
71 <xsl:when test="$choice='plain'">
72 <xsl:value-of select="$arg.choice.plain.open.str"/>
74 <xsl:when test="$choice='req'">
75 <xsl:value-of select="$arg.choice.req.open.str"/>
77 <xsl:when test="$choice='opt'">
78 <xsl:value-of select="$arg.choice.opt.open.str"/>
81 <xsl:value-of select="$arg.choice.def.open.str"/>
84 <xsl:apply-templates/>
86 <xsl:when test="$rep='repeat'">
87 <xsl:value-of select="$arg.rep.repeat.str"/>
89 <xsl:when test="$rep='norepeat'">
90 <xsl:value-of select="$arg.rep.norepeat.str"/>
93 <xsl:value-of select="$arg.rep.def.str"/>
97 <xsl:when test="$choice='plain'">
98 <xsl:value-of select="$arg.choice.plain.close.str"/>
100 <xsl:when test="$choice='req'">
101 <xsl:value-of select="$arg.choice.req.close.str"/>
103 <xsl:when test="$choice='opt'">
104 <xsl:value-of select="$arg.choice.opt.close.str"/>
107 <xsl:value-of select="$arg.choice.def.close.str"/>
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"/>
118 <xsl:call-template name="group-or-arg"/>
121 <xsl:template match="sbr">
125 <!-- ==================================================================== -->
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"/>
132 <em xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
133 <a href="#{@linkend}">
134 <xsl:text>(</xsl:text>
135 <xsl:value-of select="$snum"/>
136 <xsl:text>)</xsl:text>
138 <xsl:text> </xsl:text>
139 <xsl:apply-templates/>
143 <xsl:template match="synopfragment" mode="synopfragment.number">
144 <xsl:number format="1"/>
147 <xsl:template match="synopfragment">
148 <xsl:variable name="snum">
149 <xsl:apply-templates select="." mode="synopfragment.number"/>
151 <!-- You can't introduce another <p> here, because you're
152 already in a <p> from cmdsynopsis-->
154 <xsl:variable name="id">
155 <xsl:call-template name="object.id"/>
158 <xsl:text>(</xsl:text>
159 <xsl:value-of select="$snum"/>
160 <xsl:text>)</xsl:text>
162 <xsl:text> </xsl:text>
163 <xsl:apply-templates/>
167 <xsl:template match="funcsynopsis">
168 <xsl:if test="..//processing-instruction('dbfunclist')">
169 <!-- * Placing a dbfunclist PI as a child of a particular element -->
170 <!-- * creates a hyperlinked list of all funcsynopsis instances that -->
171 <!-- * are descendants of that element; so for any funcsynopsis that is -->
172 <!-- * a descendant of an element containing a dbfunclist PI, we need -->
173 <!-- * to output an a@id instance so that we will have something to -->
175 <xsl:call-template name="anchor">
176 <xsl:with-param name="conditional" select="0"/>
179 <xsl:call-template name="informal.object"/>
182 <xsl:template match="funcsynopsisinfo">
184 <xsl:apply-templates select="." mode="common.html.attributes"/>
185 <xsl:apply-templates/>
189 <!-- ====================================================================== -->
190 <!-- funcprototype -->
193 funcprototype ::= (funcdef,
194 (void|varargs|paramdef+))
196 funcdef ::= (#PCDATA|type|replaceable|function)*
198 paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
201 <xsl:template match="funcprototype">
202 <xsl:variable name="html-style">
203 <xsl:call-template name="pi.dbhtml_funcsynopsis-style">
204 <xsl:with-param name="node" select="ancestor::funcsynopsis/descendant-or-self::*"/>
208 <xsl:variable name="style">
210 <xsl:when test="$html-style != ''">
211 <xsl:value-of select="$html-style"/>
214 <xsl:value-of select="$funcsynopsis.style"/>
219 <!-- * 2008-02-17. the code no longer relies on the funcsynopsis.tabular.threshold -->
220 <!-- * param at all (the stuff below has been commented out since mid -->
221 <!-- * 2006), so I completely removed the funcsynopsis.tabular.threshold param -->
222 <!-- * .. MikeSmith -->
224 <xsl:variable name="tabular-p"
225 select="$funcsynopsis.tabular.threshold > 0
226 and string-length(.) > $funcsynopsis.tabular.threshold"/>
229 <xsl:variable name="tabular-p" select="true()"/>
232 <xsl:when test="$style = 'kr' and $tabular-p">
233 <xsl:apply-templates select="." mode="kr-tabular"/>
235 <xsl:when test="$style = 'kr'">
236 <xsl:apply-templates select="." mode="kr-nontabular"/>
238 <xsl:when test="$style = 'ansi' and $tabular-p">
239 <xsl:apply-templates select="." mode="ansi-tabular"/>
242 <xsl:apply-templates select="." mode="ansi-nontabular"/>
247 <!-- ====================================================================== -->
248 <!-- funcprototype: kr, non-tabular -->
250 <xsl:template match="funcprototype" mode="kr-nontabular">
252 <xsl:apply-templates mode="kr-nontabular"/>
253 <xsl:if test="paramdef">
255 <xsl:apply-templates select="paramdef" mode="kr-funcsynopsis-mode"/>
260 <xsl:template match="funcdef" mode="kr-nontabular">
262 <xsl:apply-templates select="." mode="common.html.attributes"/>
263 <xsl:apply-templates mode="kr-nontabular"/>
264 <xsl:text>(</xsl:text>
268 <xsl:template match="funcdef/function" mode="kr-nontabular">
270 <xsl:when test="$funcsynopsis.decoration != 0">
271 <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">fsfunc<xsl:apply-templates mode="kr-nontabular"/></strong>
274 <xsl:apply-templates mode="kr-nontabular"/>
279 <xsl:template match="void" mode="kr-nontabular">
281 <xsl:text>;</xsl:text>
284 <xsl:template match="varargs" mode="kr-nontabular">
285 <xsl:text>...</xsl:text>
287 <xsl:text>;</xsl:text>
290 <xsl:template match="paramdef" mode="kr-nontabular">
291 <xsl:apply-templates select="parameter" mode="kr-nontabular"/>
293 <xsl:when test="following-sibling::*">
294 <xsl:text>, </xsl:text>
298 <xsl:text>;</xsl:text>
303 <xsl:template match="paramdef/parameter" mode="kr-nontabular">
305 <xsl:when test="$funcsynopsis.decoration != 0">
306 <var class="pdparam">
307 <xsl:apply-templates mode="kr-nontabular"/>
312 <xsl:apply-templates mode="kr-nontabular"/>
318 <xsl:template match="paramdef" mode="kr-funcsynopsis-mode">
319 <xsl:if test="preceding-sibling::paramdef"><br/></xsl:if>
321 <xsl:apply-templates mode="kr-funcsynopsis-mode"/>
323 <xsl:text>;</xsl:text>
326 <xsl:template match="paramdef/parameter" mode="kr-funcsynopsis-mode">
328 <xsl:when test="$funcsynopsis.decoration != 0">
329 <var class="pdparam">
330 <xsl:apply-templates mode="kr-funcsynopsis-mode"/>
335 <xsl:apply-templates mode="kr-funcsynopsis-mode"/>
341 <xsl:template match="funcparams" mode="kr-funcsynopsis-mode">
343 <xsl:apply-templates mode="kr-funcsynopsis-mode"/>
347 <!-- ====================================================================== -->
348 <!-- funcprototype: kr, tabular -->
350 <xsl:template match="funcprototype" mode="kr-tabular">
351 <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table">
354 <xsl:apply-templates select="funcdef" mode="kr-tabular"/>
356 <xsl:apply-templates select="(void|varargs|paramdef)[1]" mode="kr-tabular"/>
358 <xsl:for-each select="(void|varargs|paramdef)[preceding-sibling::*[not(self::funcdef)]]">
361 <xsl:apply-templates select="." mode="kr-tabular"/>
365 <xsl:if test="paramdef">
366 <div class="paramdef-list">
367 <xsl:apply-templates select="paramdef" mode="kr-funcsynopsis-mode"/>
370 <div class="funcprototype-spacer"> </div> <!-- hACk: blank div for vertical spacing -->
373 <xsl:template match="funcdef" mode="kr-tabular">
375 <xsl:apply-templates select="." mode="common.html.attributes"/>
376 <xsl:apply-templates mode="kr-tabular"/>
377 <xsl:text>(</xsl:text>
381 <xsl:template match="funcdef/function" mode="kr-tabular">
383 <xsl:when test="$funcsynopsis.decoration != 0">
384 <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">fsfunc<xsl:apply-templates mode="kr-nontabular"/></strong>
387 <xsl:apply-templates mode="kr-tabular"/>
392 <xsl:template match="void" mode="kr-tabular">
395 <xsl:text>;</xsl:text>
400 <xsl:template match="varargs" mode="kr-tabular">
402 <xsl:text>...</xsl:text>
404 <xsl:text>;</xsl:text>
409 <xsl:template match="paramdef" mode="kr-tabular">
411 <xsl:apply-templates select="parameter" mode="kr-tabular"/>
413 <xsl:when test="following-sibling::*">
414 <xsl:text>, </xsl:text>
418 <xsl:text>;</xsl:text>
425 <xsl:template match="paramdef/parameter" mode="kr-tabular">
427 <xsl:when test="$funcsynopsis.decoration != 0">
428 <var class="pdparam">
429 <xsl:apply-templates mode="kr-tabular"/>
434 <xsl:apply-templates mode="kr-tabular"/>
440 <xsl:template match="paramdef" mode="kr-tabular-funcsynopsis-mode">
441 <xsl:variable name="type">
443 <xsl:when test="type">
444 <xsl:apply-templates select="type" mode="kr-tabular-funcsynopsis-mode"/>
446 <xsl:when test="normalize-space(parameter/preceding-sibling::node()[not(self::parameter)]) != ''">
447 <xsl:copy-of select="parameter/preceding-sibling::node()[not(self::parameter)]"/>
454 <xsl:when test="$type != '' and funcparams">
457 <xsl:copy-of select="$type"/>
459 <xsl:text> </xsl:text>
464 <xsl:when test="type">
465 <xsl:apply-templates select="type/following-sibling::*" mode="kr-tabular-funcsynopsis-mode"/>
468 <xsl:apply-templates select="*" mode="kr-tabular-funcsynopsis-mode"/>
475 <xsl:when test="funcparams">
478 <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/>
486 <xsl:apply-templates select="parameter/preceding-sibling::node()[not(self::parameter)]" mode="kr-tabular-funcsynopsis-mode"/>
488 <xsl:text> </xsl:text>
492 <xsl:apply-templates select="parameter" mode="kr-tabular"/>
493 <xsl:apply-templates select="parameter/following-sibling::*[not(self::parameter)]" mode="kr-tabular-funcsynopsis-mode"/>
494 <xsl:text>;</xsl:text>
502 <xsl:template match="paramdef/parameter" mode="kr-tabular-funcsynopsis-mode">
504 <xsl:when test="$funcsynopsis.decoration != 0">
505 <var class="pdparam">
506 <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/>
511 <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/>
517 <xsl:template match="funcparams" mode="kr-tabular-funcsynopsis-mode">
519 <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/>
521 <xsl:text>;</xsl:text>
524 <!-- ====================================================================== -->
525 <!-- funcprototype: ansi, non-tabular -->
527 <xsl:template match="funcprototype" mode="ansi-nontabular">
529 <xsl:apply-templates mode="ansi-nontabular"/>
533 <xsl:template match="funcdef" mode="ansi-nontabular">
535 <xsl:apply-templates select="." mode="common.html.attributes"/>
536 <xsl:apply-templates mode="ansi-nontabular"/>
537 <xsl:text>(</xsl:text>
541 <xsl:template match="funcdef/function" mode="ansi-nontabular">
543 <xsl:when test="$funcsynopsis.decoration != 0">
544 <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">fsfunc<xsl:apply-templates mode="ansi-nontabular"/></strong>
547 <xsl:apply-templates mode="ansi-nontabular"/>
552 <xsl:template match="void" mode="ansi-nontabular">
554 <xsl:text>;</xsl:text>
557 <xsl:template match="varargs" mode="ansi-nontabular">
558 <xsl:text>...</xsl:text>
560 <xsl:text>;</xsl:text>
563 <xsl:template match="paramdef" mode="ansi-nontabular">
564 <xsl:apply-templates mode="ansi-nontabular"/>
566 <xsl:when test="following-sibling::*">
567 <xsl:text>, </xsl:text>
571 <xsl:text>;</xsl:text>
576 <xsl:template match="paramdef/parameter" mode="ansi-nontabular">
578 <xsl:when test="$funcsynopsis.decoration != 0">
579 <var class="pdparam">
580 <xsl:apply-templates mode="ansi-nontabular"/>
585 <xsl:apply-templates mode="ansi-nontabular"/>
591 <xsl:template match="funcparams" mode="ansi-nontabular">
593 <xsl:apply-templates mode="ansi-nontabular"/>
597 <!-- ====================================================================== -->
598 <!-- funcprototype: ansi, tabular -->
600 <xsl:template match="funcprototype" mode="ansi-tabular">
601 <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table">
604 <xsl:apply-templates select="funcdef" mode="ansi-tabular"/>
606 <xsl:apply-templates select="(void|varargs|paramdef)[1]" mode="ansi-tabular"/>
608 <xsl:for-each select="(void|varargs|paramdef)[preceding-sibling::*[not(self::funcdef)]]">
611 <xsl:apply-templates select="." mode="ansi-tabular"/>
615 <div class="funcprototype-spacer"> </div> <!-- hACk: blank div for vertical spacing -->
618 <xsl:template match="funcdef" mode="ansi-tabular">
620 <xsl:apply-templates select="." mode="common.html.attributes"/>
621 <xsl:apply-templates mode="ansi-tabular"/>
622 <xsl:text>(</xsl:text>
626 <xsl:template match="funcdef/function" mode="ansi-tabular">
628 <xsl:when test="$funcsynopsis.decoration != 0">
629 <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">fsfunc<xsl:apply-templates mode="ansi-nontabular"/></strong>
632 <xsl:apply-templates mode="kr-tabular"/>
637 <xsl:template match="void" mode="ansi-tabular">
640 <xsl:text>;</xsl:text>
645 <xsl:template match="varargs" mode="ansi-tabular">
647 <xsl:text>...</xsl:text>
649 <xsl:text>;</xsl:text>
654 <xsl:template match="paramdef" mode="ansi-tabular">
656 <xsl:apply-templates mode="ansi-tabular"/>
658 <xsl:when test="following-sibling::*">
659 <xsl:text>, </xsl:text>
663 <xsl:text>;</xsl:text>
669 <xsl:template match="paramdef/parameter" mode="ansi-tabular">
671 <xsl:when test="$funcsynopsis.decoration != 0">
672 <var class="pdparam">
673 <xsl:apply-templates mode="ansi-tabular"/>
678 <xsl:apply-templates mode="ansi-tabular"/>
684 <xsl:template match="funcparams" mode="ansi-tabular">
686 <xsl:apply-templates/>
690 <!-- ====================================================================== -->
692 <xsl:variable name="default-classsynopsis-language">java</xsl:variable>
694 <xsl:template match="classsynopsis |fieldsynopsis |methodsynopsis |constructorsynopsis |destructorsynopsis">
695 <xsl:param name="language">
697 <xsl:when test="@language">
698 <xsl:value-of select="@language"/>
701 <xsl:value-of select="$default-classsynopsis-language"/>
707 <xsl:when test="$language='java' or $language='Java'">
708 <xsl:apply-templates select="." mode="java"/>
710 <xsl:when test="$language='perl' or $language='Perl'">
711 <xsl:apply-templates select="." mode="perl"/>
713 <xsl:when test="$language='idl' or $language='IDL'">
714 <xsl:apply-templates select="." mode="idl"/>
716 <xsl:when test="$language='cpp' or $language='c++' or $language='C++'">
717 <xsl:apply-templates select="." mode="cpp"/>
721 <xsl:text>Unrecognized language on </xsl:text>
722 <xsl:value-of select="local-name(.)"/>
723 <xsl:text>: </xsl:text>
724 <xsl:value-of select="$language"/>
726 <xsl:apply-templates select=".">
727 <xsl:with-param name="language" select="$default-classsynopsis-language"/>
728 </xsl:apply-templates>
733 <xsl:template name="synop-break">
734 <xsl:if test="parent::classsynopsis or (following-sibling::fieldsynopsis |following-sibling::methodsynopsis |following-sibling::constructorsynopsis |following-sibling::destructorsynopsis)">
740 <!-- ===== Java ======================================================== -->
742 <xsl:template match="classsynopsis" mode="java">
744 <xsl:apply-templates select="." mode="common.html.attributes"/>
745 <xsl:apply-templates select="ooclass[1]" mode="java"/>
746 <xsl:if test="ooclass[preceding-sibling::*]">
747 <xsl:text> extends</xsl:text>
748 <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="java"/>
749 <xsl:if test="oointerface|ooexception">
751 <xsl:text>    </xsl:text>
754 <xsl:if test="oointerface">
755 <xsl:text>implements</xsl:text>
756 <xsl:apply-templates select="oointerface" mode="java"/>
757 <xsl:if test="ooexception">
759 <xsl:text>    </xsl:text>
762 <xsl:if test="ooexception">
763 <xsl:text>throws</xsl:text>
764 <xsl:apply-templates select="ooexception" mode="java"/>
766 <xsl:text> {</xsl:text>
768 <xsl:apply-templates select="constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode="java"/>
769 <xsl:text>}</xsl:text>
773 <xsl:template match="classsynopsisinfo" mode="java">
774 <xsl:apply-templates mode="java"/>
777 <xsl:template match="ooclass|oointerface|ooexception" mode="java">
779 <xsl:when test="preceding-sibling::*">
780 <xsl:text>, </xsl:text>
783 <xsl:text> </xsl:text>
787 <xsl:apply-templates select="." mode="common.html.attributes"/>
788 <xsl:apply-templates mode="java"/>
792 <xsl:template match="modifier|package" mode="java">
794 <xsl:apply-templates select="." mode="common.html.attributes"/>
795 <xsl:apply-templates mode="java"/>
796 <xsl:if test="following-sibling::*">
797 <xsl:text> </xsl:text>
802 <xsl:template match="classname" mode="java">
803 <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
804 <xsl:text>, </xsl:text>
807 <xsl:apply-templates select="." mode="common.html.attributes"/>
808 <xsl:apply-templates mode="java"/>
812 <xsl:template match="interfacename" mode="java">
813 <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
814 <xsl:text>, </xsl:text>
817 <xsl:apply-templates select="." mode="common.html.attributes"/>
818 <xsl:apply-templates mode="java"/>
822 <xsl:template match="exceptionname" mode="java">
823 <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
824 <xsl:text>, </xsl:text>
827 <xsl:apply-templates select="." mode="common.html.attributes"/>
828 <xsl:apply-templates mode="java"/>
832 <xsl:template match="fieldsynopsis" mode="java">
834 <xsl:apply-templates select="." mode="common.html.attributes"/>
835 <xsl:if test="parent::classsynopsis">
836 <xsl:text>  </xsl:text>
838 <xsl:apply-templates mode="java"/>
839 <xsl:text>;</xsl:text>
841 <xsl:call-template name="synop-break"/>
844 <xsl:template match="type" mode="java">
846 <xsl:apply-templates select="." mode="common.html.attributes"/>
847 <xsl:apply-templates mode="java"/>
848 <xsl:text> </xsl:text>
852 <xsl:template match="varname" mode="java">
854 <xsl:apply-templates select="." mode="common.html.attributes"/>
855 <xsl:apply-templates mode="java"/>
856 <xsl:text> </xsl:text>
860 <xsl:template match="initializer" mode="java">
862 <xsl:apply-templates select="." mode="common.html.attributes"/>
863 <xsl:text>= </xsl:text>
864 <xsl:apply-templates mode="java"/>
868 <xsl:template match="void" mode="java">
870 <xsl:apply-templates select="." mode="common.html.attributes"/>
871 <xsl:text>void </xsl:text>
875 <xsl:template match="methodname" mode="java">
877 <xsl:apply-templates select="." mode="common.html.attributes"/>
878 <xsl:apply-templates mode="java"/>
882 <xsl:template match="methodparam" mode="java">
883 <xsl:param name="indent">0</xsl:param>
884 <xsl:if test="preceding-sibling::methodparam">
885 <xsl:text>,</xsl:text>
887 <xsl:if test="$indent > 0">
888 <xsl:call-template name="copy-string">
889 <xsl:with-param name="string"> </xsl:with-param>
890 <xsl:with-param name="count" select="$indent + 1"/>
895 <xsl:apply-templates select="." mode="common.html.attributes"/>
896 <xsl:apply-templates mode="java"/>
900 <xsl:template match="parameter" mode="java">
902 <xsl:apply-templates select="." mode="common.html.attributes"/>
903 <xsl:apply-templates mode="java"/>
907 <xsl:template mode="java" match="constructorsynopsis|destructorsynopsis|methodsynopsis">
908 <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
909 <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
910 <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
911 <xsl:variable name="decl">
912 <xsl:if test="parent::classsynopsis">
913 <xsl:text>  </xsl:text>
915 <xsl:apply-templates select="$start-modifiers" mode="java"/>
918 <xsl:if test="local-name($notmod[1]) != 'methodname'">
919 <xsl:apply-templates select="$notmod[1]" mode="java"/>
922 <xsl:apply-templates select="methodname" mode="java"/>
926 <xsl:apply-templates select="." mode="common.html.attributes"/>
927 <xsl:copy-of select="$decl"/>
928 <xsl:text>(</xsl:text>
929 <xsl:apply-templates select="methodparam" mode="java">
930 <xsl:with-param name="indent" select="string-length($decl)"/>
931 </xsl:apply-templates>
932 <xsl:text>)</xsl:text>
933 <xsl:if test="exceptionname">
935 <xsl:text>    throws </xsl:text>
936 <xsl:apply-templates select="exceptionname" mode="java"/>
938 <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
939 <xsl:text> </xsl:text>
940 <xsl:apply-templates select="$end-modifiers" mode="java"/>
942 <xsl:text>;</xsl:text>
944 <xsl:call-template name="synop-break"/>
947 <!-- ===== C++ ========================================================= -->
949 <xsl:template match="classsynopsis" mode="cpp">
951 <xsl:apply-templates select="." mode="common.html.attributes"/>
952 <xsl:apply-templates select="ooclass[1]" mode="cpp"/>
953 <xsl:if test="ooclass[preceding-sibling::*]">
954 <xsl:text>: </xsl:text>
955 <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="cpp"/>
956 <xsl:if test="oointerface|ooexception">
958 <xsl:text>    </xsl:text>
961 <xsl:if test="oointerface">
962 <xsl:text> implements</xsl:text>
963 <xsl:apply-templates select="oointerface" mode="cpp"/>
964 <xsl:if test="ooexception">
966 <xsl:text>    </xsl:text>
969 <xsl:if test="ooexception">
970 <xsl:text> throws</xsl:text>
971 <xsl:apply-templates select="ooexception" mode="cpp"/>
973 <xsl:text> {</xsl:text>
975 <xsl:apply-templates select="constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode="cpp"/>
976 <xsl:text>}</xsl:text>
980 <xsl:template match="classsynopsisinfo" mode="cpp">
981 <xsl:apply-templates mode="cpp"/>
984 <xsl:template match="ooclass|oointerface|ooexception" mode="cpp">
985 <xsl:if test="preceding-sibling::*">
986 <xsl:text>, </xsl:text>
989 <xsl:apply-templates select="." mode="common.html.attributes"/>
990 <xsl:apply-templates mode="cpp"/>
994 <xsl:template match="modifier|package" mode="cpp">
996 <xsl:apply-templates select="." mode="common.html.attributes"/>
997 <xsl:apply-templates mode="cpp"/>
998 <xsl:if test="following-sibling::*">
999 <xsl:text> </xsl:text>
1004 <xsl:template match="classname" mode="cpp">
1005 <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
1006 <xsl:text>, </xsl:text>
1009 <xsl:apply-templates select="." mode="common.html.attributes"/>
1010 <xsl:apply-templates mode="cpp"/>
1014 <xsl:template match="interfacename" mode="cpp">
1015 <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
1016 <xsl:text>, </xsl:text>
1019 <xsl:apply-templates select="." mode="common.html.attributes"/>
1020 <xsl:apply-templates mode="cpp"/>
1024 <xsl:template match="exceptionname" mode="cpp">
1025 <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
1026 <xsl:text>, </xsl:text>
1029 <xsl:apply-templates select="." mode="common.html.attributes"/>
1030 <xsl:apply-templates mode="cpp"/>
1034 <xsl:template match="fieldsynopsis" mode="cpp">
1036 <xsl:apply-templates select="." mode="common.html.attributes"/>
1037 <xsl:if test="parent::classsynopsis">
1038 <xsl:text>  </xsl:text>
1040 <xsl:apply-templates mode="cpp"/>
1041 <xsl:text>;</xsl:text>
1043 <xsl:call-template name="synop-break"/>
1046 <xsl:template match="type" mode="cpp">
1048 <xsl:apply-templates select="." mode="common.html.attributes"/>
1049 <xsl:apply-templates mode="cpp"/>
1050 <xsl:text> </xsl:text>
1054 <xsl:template match="varname" mode="cpp">
1056 <xsl:apply-templates select="." mode="common.html.attributes"/>
1057 <xsl:apply-templates mode="cpp"/>
1058 <xsl:text> </xsl:text>
1062 <xsl:template match="initializer" mode="cpp">
1064 <xsl:apply-templates select="." mode="common.html.attributes"/>
1065 <xsl:text>= </xsl:text>
1066 <xsl:apply-templates mode="cpp"/>
1070 <xsl:template match="void" mode="cpp">
1072 <xsl:apply-templates select="." mode="common.html.attributes"/>
1073 <xsl:text>void </xsl:text>
1077 <xsl:template match="methodname" mode="cpp">
1079 <xsl:apply-templates select="." mode="common.html.attributes"/>
1080 <xsl:apply-templates mode="cpp"/>
1084 <xsl:template match="methodparam" mode="cpp">
1085 <xsl:if test="preceding-sibling::methodparam">
1086 <xsl:text>, </xsl:text>
1089 <xsl:apply-templates select="." mode="common.html.attributes"/>
1090 <xsl:apply-templates mode="cpp"/>
1094 <xsl:template match="parameter" mode="cpp">
1096 <xsl:apply-templates select="." mode="common.html.attributes"/>
1097 <xsl:apply-templates mode="cpp"/>
1101 <xsl:template mode="cpp" match="constructorsynopsis|destructorsynopsis|methodsynopsis">
1102 <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
1103 <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
1104 <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
1107 <xsl:apply-templates select="." mode="common.html.attributes"/>
1108 <xsl:if test="parent::classsynopsis">
1109 <xsl:text>  </xsl:text>
1111 <xsl:apply-templates select="$start-modifiers" mode="cpp"/>
1114 <xsl:if test="local-name($notmod[1]) != 'methodname'">
1115 <xsl:apply-templates select="$notmod[1]" mode="cpp"/>
1118 <xsl:apply-templates select="methodname" mode="cpp"/>
1119 <xsl:text>(</xsl:text>
1120 <xsl:apply-templates select="methodparam" mode="cpp"/>
1121 <xsl:text>)</xsl:text>
1122 <xsl:if test="exceptionname">
1124 <xsl:text>    throws </xsl:text>
1125 <xsl:apply-templates select="exceptionname" mode="cpp"/>
1127 <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
1128 <xsl:text> </xsl:text>
1129 <xsl:apply-templates select="$end-modifiers" mode="cpp"/>
1131 <xsl:text>;</xsl:text>
1133 <xsl:call-template name="synop-break"/>
1136 <!-- ===== IDL ========================================================= -->
1138 <xsl:template match="classsynopsis" mode="idl">
1140 <xsl:apply-templates select="." mode="common.html.attributes"/>
1141 <xsl:text>interface </xsl:text>
1142 <xsl:apply-templates select="ooclass[1]" mode="idl"/>
1143 <xsl:if test="ooclass[preceding-sibling::*]">
1144 <xsl:text>: </xsl:text>
1145 <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="idl"/>
1146 <xsl:if test="oointerface|ooexception">
1148 <xsl:text>    </xsl:text>
1151 <xsl:if test="oointerface">
1152 <xsl:text> implements</xsl:text>
1153 <xsl:apply-templates select="oointerface" mode="idl"/>
1154 <xsl:if test="ooexception">
1156 <xsl:text>    </xsl:text>
1159 <xsl:if test="ooexception">
1160 <xsl:text> throws</xsl:text>
1161 <xsl:apply-templates select="ooexception" mode="idl"/>
1163 <xsl:text> {</xsl:text>
1165 <xsl:apply-templates select="constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode="idl"/>
1166 <xsl:text>}</xsl:text>
1170 <xsl:template match="classsynopsisinfo" mode="idl">
1171 <xsl:apply-templates mode="idl"/>
1174 <xsl:template match="ooclass|oointerface|ooexception" mode="idl">
1175 <xsl:if test="preceding-sibling::*">
1176 <xsl:text>, </xsl:text>
1179 <xsl:apply-templates select="." mode="common.html.attributes"/>
1180 <xsl:apply-templates mode="idl"/>
1184 <xsl:template match="modifier|package" mode="idl">
1186 <xsl:apply-templates select="." mode="common.html.attributes"/>
1187 <xsl:apply-templates mode="idl"/>
1188 <xsl:if test="following-sibling::*">
1189 <xsl:text> </xsl:text>
1194 <xsl:template match="classname" mode="idl">
1195 <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
1196 <xsl:text>, </xsl:text>
1199 <xsl:apply-templates select="." mode="common.html.attributes"/>
1200 <xsl:apply-templates mode="idl"/>
1204 <xsl:template match="interfacename" mode="idl">
1205 <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
1206 <xsl:text>, </xsl:text>
1209 <xsl:apply-templates select="." mode="common.html.attributes"/>
1210 <xsl:apply-templates mode="idl"/>
1214 <xsl:template match="exceptionname" mode="idl">
1215 <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
1216 <xsl:text>, </xsl:text>
1219 <xsl:apply-templates select="." mode="common.html.attributes"/>
1220 <xsl:apply-templates mode="idl"/>
1224 <xsl:template match="fieldsynopsis" mode="idl">
1226 <xsl:apply-templates select="." mode="common.html.attributes"/>
1227 <xsl:if test="parent::classsynopsis">
1228 <xsl:text>  </xsl:text>
1230 <xsl:apply-templates mode="idl"/>
1231 <xsl:text>;</xsl:text>
1233 <xsl:call-template name="synop-break"/>
1236 <xsl:template match="type" mode="idl">
1238 <xsl:apply-templates select="." mode="common.html.attributes"/>
1239 <xsl:apply-templates mode="idl"/>
1240 <xsl:text> </xsl:text>
1244 <xsl:template match="varname" mode="idl">
1246 <xsl:apply-templates select="." mode="common.html.attributes"/>
1247 <xsl:apply-templates mode="idl"/>
1248 <xsl:text> </xsl:text>
1252 <xsl:template match="initializer" mode="idl">
1254 <xsl:apply-templates select="." mode="common.html.attributes"/>
1255 <xsl:text>= </xsl:text>
1256 <xsl:apply-templates mode="idl"/>
1260 <xsl:template match="void" mode="idl">
1262 <xsl:apply-templates select="." mode="common.html.attributes"/>
1263 <xsl:text>void </xsl:text>
1267 <xsl:template match="methodname" mode="idl">
1269 <xsl:apply-templates select="." mode="common.html.attributes"/>
1270 <xsl:apply-templates mode="idl"/>
1274 <xsl:template match="methodparam" mode="idl">
1275 <xsl:if test="preceding-sibling::methodparam">
1276 <xsl:text>, </xsl:text>
1279 <xsl:apply-templates select="." mode="common.html.attributes"/>
1280 <xsl:apply-templates mode="idl"/>
1284 <xsl:template match="parameter" mode="idl">
1286 <xsl:apply-templates select="." mode="common.html.attributes"/>
1287 <xsl:apply-templates mode="idl"/>
1291 <xsl:template mode="idl" match="constructorsynopsis|destructorsynopsis|methodsynopsis">
1292 <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
1293 <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
1294 <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
1296 <xsl:apply-templates select="." mode="common.html.attributes"/>
1297 <xsl:if test="parent::classsynopsis">
1298 <xsl:text>  </xsl:text>
1300 <xsl:apply-templates select="$start-modifiers" mode="idl"/>
1303 <xsl:if test="local-name($notmod[1]) != 'methodname'">
1304 <xsl:apply-templates select="$notmod[1]" mode="idl"/>
1307 <xsl:apply-templates select="methodname" mode="idl"/>
1308 <xsl:text>(</xsl:text>
1309 <xsl:apply-templates select="methodparam" mode="idl"/>
1310 <xsl:text>)</xsl:text>
1311 <xsl:if test="exceptionname">
1313 <xsl:text>    raises(</xsl:text>
1314 <xsl:apply-templates select="exceptionname" mode="idl"/>
1315 <xsl:text>)</xsl:text>
1317 <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
1318 <xsl:text> </xsl:text>
1319 <xsl:apply-templates select="$end-modifiers" mode="idl"/>
1321 <xsl:text>;</xsl:text>
1323 <xsl:call-template name="synop-break"/>
1326 <!-- ===== Perl ======================================================== -->
1328 <xsl:template match="classsynopsis" mode="perl">
1330 <xsl:apply-templates select="." mode="common.html.attributes"/>
1331 <xsl:text>package </xsl:text>
1332 <xsl:apply-templates select="ooclass[1]" mode="perl"/>
1333 <xsl:text>;</xsl:text>
1336 <xsl:if test="ooclass[preceding-sibling::*]">
1337 <xsl:text>@ISA = (</xsl:text>
1338 <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="perl"/>
1339 <xsl:text>);</xsl:text>
1343 <xsl:apply-templates select="constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode="perl"/>
1347 <xsl:template match="classsynopsisinfo" mode="perl">
1348 <xsl:apply-templates mode="perl"/>
1351 <xsl:template match="ooclass|oointerface|ooexception" mode="perl">
1352 <xsl:if test="preceding-sibling::*">
1353 <xsl:text>, </xsl:text>
1356 <xsl:apply-templates select="." mode="common.html.attributes"/>
1357 <xsl:apply-templates mode="perl"/>
1361 <xsl:template match="modifier|package" mode="perl">
1363 <xsl:apply-templates select="." mode="common.html.attributes"/>
1364 <xsl:apply-templates mode="perl"/>
1365 <xsl:if test="following-sibling::*">
1366 <xsl:text> </xsl:text>
1371 <xsl:template match="classname" mode="perl">
1372 <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
1373 <xsl:text>, </xsl:text>
1376 <xsl:apply-templates select="." mode="common.html.attributes"/>
1377 <xsl:apply-templates mode="perl"/>
1381 <xsl:template match="interfacename" mode="perl">
1382 <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
1383 <xsl:text>, </xsl:text>
1386 <xsl:apply-templates select="." mode="common.html.attributes"/>
1387 <xsl:apply-templates mode="perl"/>
1391 <xsl:template match="exceptionname" mode="perl">
1392 <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
1393 <xsl:text>, </xsl:text>
1396 <xsl:apply-templates select="." mode="common.html.attributes"/>
1397 <xsl:apply-templates mode="perl"/>
1401 <xsl:template match="fieldsynopsis" mode="perl">
1403 <xsl:apply-templates select="." mode="common.html.attributes"/>
1404 <xsl:if test="parent::classsynopsis">
1405 <xsl:text>  </xsl:text>
1407 <xsl:apply-templates mode="perl"/>
1408 <xsl:text>;</xsl:text>
1410 <xsl:call-template name="synop-break"/>
1413 <xsl:template match="type" mode="perl">
1415 <xsl:apply-templates select="." mode="common.html.attributes"/>
1416 <xsl:apply-templates mode="perl"/>
1417 <xsl:text> </xsl:text>
1421 <xsl:template match="varname" mode="perl">
1423 <xsl:apply-templates select="." mode="common.html.attributes"/>
1424 <xsl:apply-templates mode="perl"/>
1425 <xsl:text> </xsl:text>
1429 <xsl:template match="initializer" mode="perl">
1431 <xsl:apply-templates select="." mode="common.html.attributes"/>
1432 <xsl:text>= </xsl:text>
1433 <xsl:apply-templates mode="perl"/>
1437 <xsl:template match="void" mode="perl">
1439 <xsl:apply-templates select="." mode="common.html.attributes"/>
1440 <xsl:text>void </xsl:text>
1444 <xsl:template match="methodname" mode="perl">
1446 <xsl:apply-templates select="." mode="common.html.attributes"/>
1447 <xsl:apply-templates mode="perl"/>
1451 <xsl:template match="methodparam" mode="perl">
1452 <xsl:if test="preceding-sibling::methodparam">
1453 <xsl:text>, </xsl:text>
1456 <xsl:apply-templates select="." mode="common.html.attributes"/>
1457 <xsl:apply-templates mode="perl"/>
1461 <xsl:template match="parameter" mode="perl">
1463 <xsl:apply-templates select="." mode="common.html.attributes"/>
1464 <xsl:apply-templates mode="perl"/>
1468 <xsl:template mode="perl" match="constructorsynopsis|destructorsynopsis|methodsynopsis">
1469 <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
1470 <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
1471 <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
1474 <xsl:apply-templates select="." mode="common.html.attributes"/>
1475 <xsl:text>sub </xsl:text>
1477 <xsl:apply-templates select="methodname" mode="perl"/>
1478 <xsl:text> { ... };</xsl:text>
1480 <xsl:call-template name="synop-break"/>
1483 <!-- Used when not occurring as a child of classsynopsis -->
1484 <xsl:template match="ooclass|oointerface|ooexception">
1485 <xsl:apply-templates/>
1488 <!-- ==================================================================== -->
1490 <!-- * DocBook 5 allows linking elements (link, olink, and xref) -->
1491 <!-- * within the OO *synopsis elements (classsynopsis, fieldsynopsis, -->
1492 <!-- * methodsynopsis, constructorsynopsis, destructorsynopsis) and -->
1493 <!-- * their children. So we need to have mode="java|cpp|idl|perl" -->
1494 <!-- * per-mode matches for those linking elements in order for them -->
1495 <!-- * to be processed as expected. -->
1497 <xsl:template match="link|olink|xref" mode="java">
1498 <xsl:apply-templates select="."/>
1501 <xsl:template match="link|olink|xref" mode="cpp">
1502 <xsl:apply-templates select="."/>
1505 <xsl:template match="link|olink|xref" mode="idl">
1506 <xsl:apply-templates select="."/>
1509 <xsl:template match="link|olink|xref" mode="perl">
1510 <xsl:apply-templates select="."/>