1 <?xml version=
"1.0" encoding=
"UTF-8"?><xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" version=
"1.0">
3 <!-- ********************************************************************
4 $Id: html-synop.xsl,v 1.1 2007/03/10 05:15:34 scott Exp $
5 ********************************************************************
7 This file is part of the XSL DocBook Stylesheet distribution.
8 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
11 ******************************************************************** -->
13 <!-- ==================================================================== -->
15 <!-- synopsis is in verbatim -->
17 <!-- ==================================================================== -->
19 <xsl:template match=
"cmdsynopsis">
21 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
23 <xsl:call-template name=
"anchor"/>
24 <xsl:apply-templates/>
29 <xsl:template match=
"cmdsynopsis/command">
33 <xsl:call-template name=
"inline.monoseq"/>
34 <xsl:text> </xsl:text>
37 <xsl:template match=
"cmdsynopsis/command[1]" priority=
"2">
38 <xsl:call-template name=
"inline.monoseq"/>
39 <xsl:text> </xsl:text>
42 <xsl:template match=
"group|arg" name=
"group-or-arg">
43 <xsl:variable name=
"choice" select=
"@choice"/>
44 <xsl:variable name=
"rep" select=
"@rep"/>
45 <xsl:variable name=
"sepchar">
47 <xsl:when test=
"ancestor-or-self::*/@sepchar">
48 <xsl:value-of select=
"ancestor-or-self::*/@sepchar"/>
51 <xsl:text> </xsl:text>
56 <xsl:if test=
"preceding-sibling::*">
57 <xsl:value-of select=
"$sepchar"/>
60 <xsl:when test=
"$choice='plain'">
61 <xsl:value-of select=
"$arg.choice.plain.open.str"/>
63 <xsl:when test=
"$choice='req'">
64 <xsl:value-of select=
"$arg.choice.req.open.str"/>
66 <xsl:when test=
"$choice='opt'">
67 <xsl:value-of select=
"$arg.choice.opt.open.str"/>
70 <xsl:value-of select=
"$arg.choice.def.open.str"/>
73 <xsl:apply-templates/>
75 <xsl:when test=
"$rep='repeat'">
76 <xsl:value-of select=
"$arg.rep.repeat.str"/>
78 <xsl:when test=
"$rep='norepeat'">
79 <xsl:value-of select=
"$arg.rep.norepeat.str"/>
82 <xsl:value-of select=
"$arg.rep.def.str"/>
86 <xsl:when test=
"$choice='plain'">
87 <xsl:value-of select=
"$arg.choice.plain.close.str"/>
89 <xsl:when test=
"$choice='req'">
90 <xsl:value-of select=
"$arg.choice.req.close.str"/>
92 <xsl:when test=
"$choice='opt'">
93 <xsl:value-of select=
"$arg.choice.opt.close.str"/>
96 <xsl:value-of select=
"$arg.choice.def.close.str"/>
101 <xsl:template match=
"group/arg">
102 <xsl:variable name=
"choice" select=
"@choice"/>
103 <xsl:variable name=
"rep" select=
"@rep"/>
104 <xsl:if test=
"preceding-sibling::*">
105 <xsl:value-of select=
"$arg.or.sep"/>
107 <xsl:call-template name=
"group-or-arg"/>
110 <xsl:template match=
"sbr">
116 <!-- ==================================================================== -->
118 <xsl:template match=
"synopfragmentref">
119 <xsl:variable name=
"target" select=
"key('id',@linkend)"/>
120 <xsl:variable name=
"snum">
121 <xsl:apply-templates select=
"$target" mode=
"synopfragment.number"/>
124 <a href=
"#{@linkend}">
125 <xsl:text>(
</xsl:text>
126 <xsl:value-of select=
"$snum"/>
127 <xsl:text>)
</xsl:text>
129 <xsl:text> </xsl:text>
130 <xsl:apply-templates/>
134 <xsl:template match=
"synopfragment" mode=
"synopfragment.number">
135 <xsl:number format=
"1"/>
138 <xsl:template match=
"synopfragment">
139 <xsl:variable name=
"snum">
140 <xsl:apply-templates select=
"." mode=
"synopfragment.number"/>
143 <xsl:variable name=
"id">
144 <xsl:call-template name=
"object.id"/>
147 <xsl:text>(
</xsl:text>
148 <xsl:value-of select=
"$snum"/>
149 <xsl:text>)
</xsl:text>
151 <xsl:text> </xsl:text>
152 <xsl:apply-templates/>
156 <xsl:template match=
"funcsynopsis">
157 <xsl:call-template name=
"informal.object"/>
160 <xsl:template match=
"funcsynopsisinfo">
162 </xsl:text><xsl:text>⌂nf
164 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
165 <xsl:apply-templates/>
166 </pre><xsl:text/><xsl:text>⌂fi
170 <!-- ====================================================================== -->
171 <!-- funcprototype -->
174 funcprototype ::= (funcdef,
175 (void|varargs|paramdef+))
177 funcdef ::= (#PCDATA|type|replaceable|function)*
179 paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
182 <xsl:template match=
"funcprototype">
183 <xsl:variable name=
"html-style">
184 <xsl:call-template name=
"dbhtml-attribute">
185 <xsl:with-param name=
"pis" select=
"ancestor::funcsynopsis//processing-instruction('dbhtml')"/>
186 <xsl:with-param name=
"attribute" select=
"'funcsynopsis-style'"/>
190 <xsl:variable name=
"style">
192 <xsl:when test=
"$html-style != ''">
193 <xsl:value-of select=
"$html-style"/>
196 <xsl:value-of select=
"$funcsynopsis.style"/>
202 <xsl:variable name="tabular-p"
203 select="$funcsynopsis.tabular.threshold > 0
204 and string-length(.) > $funcsynopsis.tabular.threshold"/>
207 <xsl:variable name=
"tabular-p" select=
"true()"/>
210 <xsl:when test=
"$style = 'kr' and $tabular-p">
211 <xsl:apply-templates select=
"." mode=
"kr-tabular"/>
213 <xsl:when test=
"$style = 'kr'">
214 <xsl:apply-templates select=
"." mode=
"kr-nontabular"/>
216 <xsl:when test=
"$style = 'ansi' and $tabular-p">
217 <xsl:apply-templates select=
"." mode=
"ansi-tabular"/>
220 <xsl:apply-templates select=
"." mode=
"ansi-nontabular"/>
225 <!-- ====================================================================== -->
226 <!-- funcprototype: kr, non-tabular -->
228 <xsl:template match=
"funcprototype" mode=
"kr-nontabular">
230 <xsl:apply-templates mode=
"kr-nontabular"/>
231 <xsl:if test=
"paramdef">
235 <xsl:apply-templates select=
"paramdef" mode=
"kr-funcsynopsis-mode"/>
240 <xsl:template match=
"funcdef" mode=
"kr-nontabular">
242 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
243 <xsl:apply-templates mode=
"kr-nontabular"/>
244 <xsl:text>(
</xsl:text>
248 <xsl:template match=
"funcdef/function" mode=
"kr-nontabular">
250 <xsl:when test=
"$funcsynopsis.decoration != 0">
251 <b class=
"fsfunc"><xsl:apply-templates mode=
"kr-nontabular"/></b>
254 <xsl:apply-templates mode=
"kr-nontabular"/>
259 <xsl:template match=
"void" mode=
"kr-nontabular">
261 <xsl:text>;
</xsl:text>
264 <xsl:template match=
"varargs" mode=
"kr-nontabular">
265 <xsl:text>...
</xsl:text>
267 <xsl:text>;
</xsl:text>
270 <xsl:template match=
"paramdef" mode=
"kr-nontabular">
271 <xsl:apply-templates select=
"parameter" mode=
"kr-nontabular"/>
273 <xsl:when test=
"following-sibling::*">
274 <xsl:text>,
</xsl:text>
278 <xsl:text>;
</xsl:text>
283 <xsl:template match=
"paramdef/parameter" mode=
"kr-nontabular">
285 <xsl:when test=
"$funcsynopsis.decoration != 0">
286 <var class=
"pdparam">
287 <xsl:apply-templates mode=
"kr-nontabular"/>
292 <xsl:apply-templates mode=
"kr-nontabular"/>
298 <xsl:template match=
"paramdef" mode=
"kr-funcsynopsis-mode">
299 <xsl:if test=
"preceding-sibling::paramdef"><xsl:text>
303 <xsl:apply-templates mode=
"kr-funcsynopsis-mode"/>
305 <xsl:text>;
</xsl:text>
308 <xsl:template match=
"paramdef/parameter" mode=
"kr-funcsynopsis-mode">
310 <xsl:when test=
"$funcsynopsis.decoration != 0">
311 <var class=
"pdparam">
312 <xsl:apply-templates mode=
"kr-funcsynopsis-mode"/>
317 <xsl:apply-templates mode=
"kr-funcsynopsis-mode"/>
323 <xsl:template match=
"funcparams" mode=
"kr-funcsynopsis-mode">
325 <xsl:apply-templates mode=
"kr-funcsynopsis-mode"/>
329 <!-- ====================================================================== -->
330 <!-- funcprototype: kr, tabular -->
332 <xsl:template match=
"funcprototype" mode=
"kr-tabular">
333 <table border=
"0" summary=
"Function synopsis" cellspacing=
"0" cellpadding=
"0" style=
"padding-bottom: 1em">
336 <xsl:apply-templates select=
"funcdef" mode=
"kr-tabular"/>
338 <xsl:apply-templates select=
"(void|varargs|paramdef)[1]" mode=
"kr-tabular"/>
340 <xsl:for-each select=
"(void|varargs|paramdef)[preceding-sibling::*[not(self::funcdef)]]">
343 <xsl:apply-templates select=
"." mode=
"kr-tabular"/>
347 <xsl:if test=
"paramdef">
348 <table border=
"0" summary=
"Function argument synopsis" cellspacing=
"0" cellpadding=
"0">
349 <xsl:if test=
"following-sibling::funcprototype">
350 <xsl:attribute name=
"style">padding-bottom:
1em
</xsl:attribute>
352 <xsl:apply-templates select=
"paramdef" mode=
"kr-tabular-funcsynopsis-mode"/>
357 <xsl:template match=
"funcdef" mode=
"kr-tabular">
359 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
360 <xsl:apply-templates mode=
"kr-tabular"/>
361 <xsl:text>(
</xsl:text>
365 <xsl:template match=
"funcdef/function" mode=
"kr-tabular">
367 <xsl:when test=
"$funcsynopsis.decoration != 0">
368 <b class=
"fsfunc"><xsl:apply-templates mode=
"kr-nontabular"/></b>
371 <xsl:apply-templates mode=
"kr-tabular"/>
376 <xsl:template match=
"void" mode=
"kr-tabular">
379 <xsl:text>;
</xsl:text>
384 <xsl:template match=
"varargs" mode=
"kr-tabular">
386 <xsl:text>...
</xsl:text>
388 <xsl:text>;
</xsl:text>
393 <xsl:template match=
"paramdef" mode=
"kr-tabular">
395 <xsl:apply-templates select=
"parameter" mode=
"kr-tabular"/>
397 <xsl:when test=
"following-sibling::*">
398 <xsl:text>,
</xsl:text>
402 <xsl:text>;
</xsl:text>
409 <xsl:template match=
"paramdef/parameter" mode=
"kr-tabular">
411 <xsl:when test=
"$funcsynopsis.decoration != 0">
412 <var class=
"pdparam">
413 <xsl:apply-templates mode=
"kr-tabular"/>
418 <xsl:apply-templates mode=
"kr-tabular"/>
424 <xsl:template match=
"paramdef" mode=
"kr-tabular-funcsynopsis-mode">
425 <xsl:variable name=
"type">
427 <xsl:when test=
"type">
428 <xsl:apply-templates select=
"type" mode=
"kr-tabular-funcsynopsis-mode"/>
430 <xsl:when test=
"normalize-space(parameter/preceding-sibling::node()[not(self::parameter)]) != ''">
431 <xsl:copy-of select=
"parameter/preceding-sibling::node()[not(self::parameter)]"/>
438 <xsl:when test=
"$type != '' and funcparams">
441 <xsl:copy-of select=
"$type"/>
443 <xsl:text> </xsl:text>
448 <xsl:when test=
"type">
449 <xsl:apply-templates select=
"type/following-sibling::*" mode=
"kr-tabular-funcsynopsis-mode"/>
452 <xsl:apply-templates select=
"*" mode=
"kr-tabular-funcsynopsis-mode"/>
459 <xsl:when test=
"funcparams">
462 <xsl:apply-templates mode=
"kr-tabular-funcsynopsis-mode"/>
470 <xsl:apply-templates select=
"parameter/preceding-sibling::node()[not(self::parameter)]" mode=
"kr-tabular-funcsynopsis-mode"/>
472 <xsl:text> </xsl:text>
476 <xsl:apply-templates select=
"parameter" mode=
"kr-tabular"/>
477 <xsl:apply-templates select=
"parameter/following-sibling::*[not(self::parameter)]" mode=
"kr-tabular-funcsynopsis-mode"/>
478 <xsl:text>;
</xsl:text>
486 <xsl:template match=
"paramdef/parameter" mode=
"kr-tabular-funcsynopsis-mode">
488 <xsl:when test=
"$funcsynopsis.decoration != 0">
489 <var class=
"pdparam">
490 <xsl:apply-templates mode=
"kr-tabular-funcsynopsis-mode"/>
495 <xsl:apply-templates mode=
"kr-tabular-funcsynopsis-mode"/>
501 <xsl:template match=
"funcparams" mode=
"kr-tabular-funcsynopsis-mode">
503 <xsl:apply-templates mode=
"kr-tabular-funcsynopsis-mode"/>
505 <xsl:text>;
</xsl:text>
508 <!-- ====================================================================== -->
509 <!-- funcprototype: ansi, non-tabular -->
511 <xsl:template match=
"funcprototype" mode=
"ansi-nontabular">
513 <xsl:apply-templates mode=
"ansi-nontabular"/>
517 <xsl:template match=
"funcdef" mode=
"ansi-nontabular">
519 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
520 <xsl:apply-templates mode=
"ansi-nontabular"/>
521 <xsl:text>(
</xsl:text>
525 <xsl:template match=
"funcdef/function" mode=
"ansi-nontabular">
527 <xsl:when test=
"$funcsynopsis.decoration != 0">
528 <b class=
"fsfunc"><xsl:apply-templates mode=
"ansi-nontabular"/></b>
531 <xsl:apply-templates mode=
"ansi-nontabular"/>
536 <xsl:template match=
"void" mode=
"ansi-nontabular">
538 <xsl:text>;
</xsl:text>
541 <xsl:template match=
"varargs" mode=
"ansi-nontabular">
542 <xsl:text>...
</xsl:text>
544 <xsl:text>;
</xsl:text>
547 <xsl:template match=
"paramdef" mode=
"ansi-nontabular">
548 <xsl:apply-templates mode=
"ansi-nontabular"/>
550 <xsl:when test=
"following-sibling::*">
551 <xsl:text>,
</xsl:text>
555 <xsl:text>;
</xsl:text>
560 <xsl:template match=
"paramdef/parameter" mode=
"ansi-nontabular">
562 <xsl:when test=
"$funcsynopsis.decoration != 0">
563 <var class=
"pdparam">
564 <xsl:apply-templates mode=
"ansi-nontabular"/>
569 <xsl:apply-templates mode=
"ansi-nontabular"/>
575 <xsl:template match=
"funcparams" mode=
"ansi-nontabular">
577 <xsl:apply-templates mode=
"ansi-nontabular"/>
581 <!-- ====================================================================== -->
582 <!-- funcprototype: ansi, tabular -->
584 <xsl:template match=
"funcprototype" mode=
"ansi-tabular">
585 <table border=
"0" summary=
"Function synopsis" cellspacing=
"0" cellpadding=
"0">
586 <xsl:if test=
"following-sibling::funcprototype">
587 <xsl:attribute name=
"style">padding-bottom:
1em
</xsl:attribute>
591 <xsl:apply-templates select=
"funcdef" mode=
"ansi-tabular"/>
593 <xsl:apply-templates select=
"(void|varargs|paramdef)[1]" mode=
"ansi-tabular"/>
595 <xsl:for-each select=
"(void|varargs|paramdef)[preceding-sibling::*[not(self::funcdef)]]">
598 <xsl:apply-templates select=
"." mode=
"ansi-tabular"/>
604 <xsl:template match=
"funcdef" mode=
"ansi-tabular">
606 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
607 <xsl:apply-templates mode=
"ansi-tabular"/>
608 <xsl:text>(
</xsl:text>
612 <xsl:template match=
"funcdef/function" mode=
"ansi-tabular">
614 <xsl:when test=
"$funcsynopsis.decoration != 0">
615 <b class=
"fsfunc"><xsl:apply-templates mode=
"ansi-nontabular"/></b>
618 <xsl:apply-templates mode=
"kr-tabular"/>
623 <xsl:template match=
"void" mode=
"ansi-tabular">
626 <xsl:text>;
</xsl:text>
631 <xsl:template match=
"varargs" mode=
"ansi-tabular">
633 <xsl:text>...
</xsl:text>
635 <xsl:text>;
</xsl:text>
640 <xsl:template match=
"paramdef" mode=
"ansi-tabular">
641 <xsl:variable name=
"type">
643 <xsl:when test=
"type">
644 <xsl:apply-templates select=
"type" mode=
"ansi-tabular"/>
646 <xsl:when test=
"normalize-space(parameter/preceding-sibling::node()[not(self::parameter)]) != ''">
647 <xsl:copy-of select=
"parameter/preceding-sibling::node()[not(self::parameter)]"/>
653 <xsl:when test=
"$type != '' and funcparams">
655 <xsl:copy-of select=
"$type"/>
656 <xsl:text> </xsl:text>
660 <xsl:when test=
"type">
661 <xsl:apply-templates select=
"type/following-sibling::*" mode=
"ansi-tabular"/>
664 <xsl:apply-templates select=
"*" mode=
"ansi-tabular"/>
668 <xsl:when test=
"following-sibling::*">
669 <xsl:text>,
</xsl:text>
673 <xsl:text>;
</xsl:text>
680 <xsl:apply-templates select=
"parameter/preceding-sibling::node()[not(self::parameter)]" mode=
"ansi-tabular"/>
681 <xsl:text> </xsl:text>
684 <xsl:apply-templates select=
"parameter" mode=
"ansi-tabular"/>
685 <xsl:apply-templates select=
"parameter/following-sibling::*[not(self::parameter)]" mode=
"ansi-tabular"/>
687 <xsl:when test=
"following-sibling::*">
688 <xsl:text>,
</xsl:text>
692 <xsl:text>;
</xsl:text>
700 <xsl:template match=
"paramdef/parameter" mode=
"ansi-tabular">
702 <xsl:when test=
"$funcsynopsis.decoration != 0">
703 <var class=
"pdparam">
704 <xsl:apply-templates mode=
"ansi-tabular"/>
709 <xsl:apply-templates mode=
"ansi-tabular"/>
715 <xsl:template match=
"funcparams" mode=
"ansi-tabular">
717 <xsl:apply-templates/>
721 <!-- ====================================================================== -->
723 <xsl:variable name=
"default-classsynopsis-language">java
</xsl:variable>
725 <xsl:template match=
"classsynopsis |fieldsynopsis |methodsynopsis |constructorsynopsis |destructorsynopsis">
726 <xsl:param name=
"language">
728 <xsl:when test=
"@language">
729 <xsl:value-of select=
"@language"/>
732 <xsl:value-of select=
"$default-classsynopsis-language"/>
738 <xsl:when test=
"$language='java' or $language='Java'">
739 <xsl:apply-templates select=
"." mode=
"java"/>
741 <xsl:when test=
"$language='perl' or $language='Perl'">
742 <xsl:apply-templates select=
"." mode=
"perl"/>
744 <xsl:when test=
"$language='idl' or $language='IDL'">
745 <xsl:apply-templates select=
"." mode=
"idl"/>
747 <xsl:when test=
"$language='cpp' or $language='c++' or $language='C++'">
748 <xsl:apply-templates select=
"." mode=
"cpp"/>
752 <xsl:text>Unrecognized language on
</xsl:text>
753 <xsl:value-of select=
"local-name(.)"/>
754 <xsl:text>:
</xsl:text>
755 <xsl:value-of select=
"$language"/>
757 <xsl:apply-templates select=
".">
758 <xsl:with-param name=
"language" select=
"$default-classsynopsis-language"/>
759 </xsl:apply-templates>
764 <xsl:template name=
"synop-break">
765 <xsl:if test=
"parent::classsynopsis or (following-sibling::fieldsynopsis |following-sibling::methodsynopsis |following-sibling::constructorsynopsis |following-sibling::destructorsynopsis)">
773 <!-- ===== Java ======================================================== -->
775 <xsl:template match=
"classsynopsis" mode=
"java">
777 </xsl:text><xsl:text>⌂nf
779 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
780 <xsl:apply-templates select=
"ooclass[1]" mode=
"java"/>
781 <xsl:if test=
"ooclass[preceding-sibling::*]">
782 <xsl:text> extends
</xsl:text>
783 <xsl:apply-templates select=
"ooclass[preceding-sibling::*]" mode=
"java"/>
784 <xsl:if test=
"oointerface|ooexception">
788 <xsl:text> </xsl:text>
791 <xsl:if test=
"oointerface">
792 <xsl:text>implements
</xsl:text>
793 <xsl:apply-templates select=
"oointerface" mode=
"java"/>
794 <xsl:if test=
"ooexception">
798 <xsl:text> </xsl:text>
801 <xsl:if test=
"ooexception">
802 <xsl:text>throws
</xsl:text>
803 <xsl:apply-templates select=
"ooexception" mode=
"java"/>
805 <xsl:text> {
</xsl:text>
809 <xsl:apply-templates select=
"constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode=
"java"/>
810 <xsl:text>}
</xsl:text>
811 </pre><xsl:text/><xsl:text>⌂fi
815 <xsl:template match=
"classsynopsisinfo" mode=
"java">
816 <xsl:apply-templates mode=
"java"/>
819 <xsl:template match=
"ooclass|oointerface|ooexception" mode=
"java">
821 <xsl:when test=
"preceding-sibling::*">
822 <xsl:text>,
</xsl:text>
825 <xsl:text> </xsl:text>
829 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
830 <xsl:apply-templates mode=
"java"/>
834 <xsl:template match=
"modifier|package" mode=
"java">
836 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
837 <xsl:apply-templates mode=
"java"/>
838 <xsl:if test=
"following-sibling::*">
839 <xsl:text> </xsl:text>
844 <xsl:template match=
"classname" mode=
"java">
845 <xsl:if test=
"local-name(preceding-sibling::*[1]) = 'classname'">
846 <xsl:text>,
</xsl:text>
849 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
850 <xsl:apply-templates mode=
"java"/>
854 <xsl:template match=
"interfacename" mode=
"java">
855 <xsl:if test=
"local-name(preceding-sibling::*[1]) = 'interfacename'">
856 <xsl:text>,
</xsl:text>
859 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
860 <xsl:apply-templates mode=
"java"/>
864 <xsl:template match=
"exceptionname" mode=
"java">
865 <xsl:if test=
"local-name(preceding-sibling::*[1]) = 'exceptionname'">
866 <xsl:text>,
</xsl:text>
869 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
870 <xsl:apply-templates mode=
"java"/>
874 <xsl:template match=
"fieldsynopsis" mode=
"java">
876 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
877 <xsl:if test=
"parent::classsynopsis">
878 <xsl:text> </xsl:text>
880 <xsl:apply-templates mode=
"java"/>
881 <xsl:text>;
</xsl:text>
883 <xsl:call-template name=
"synop-break"/>
886 <xsl:template match=
"type" mode=
"java">
888 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
889 <xsl:apply-templates mode=
"java"/>
890 <xsl:text> </xsl:text>
894 <xsl:template match=
"varname" mode=
"java">
896 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
897 <xsl:apply-templates mode=
"java"/>
898 <xsl:text> </xsl:text>
902 <xsl:template match=
"initializer" mode=
"java">
904 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
905 <xsl:text>=
</xsl:text>
906 <xsl:apply-templates mode=
"java"/>
910 <xsl:template match=
"void" mode=
"java">
912 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
913 <xsl:text>void
</xsl:text>
917 <xsl:template match=
"methodname" mode=
"java">
919 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
920 <xsl:apply-templates mode=
"java"/>
924 <xsl:template match=
"methodparam" mode=
"java">
925 <xsl:param name=
"indent">0</xsl:param>
926 <xsl:if test=
"preceding-sibling::methodparam">
927 <xsl:text>,
</xsl:text>
931 <xsl:if test=
"$indent > 0">
932 <xsl:call-template name=
"copy-string">
933 <xsl:with-param name=
"string"> </xsl:with-param>
934 <xsl:with-param name=
"count" select=
"$indent + 1"/>
939 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
940 <xsl:apply-templates mode=
"java"/>
944 <xsl:template match=
"parameter" mode=
"java">
946 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
947 <xsl:apply-templates mode=
"java"/>
951 <xsl:template mode=
"java" match=
"constructorsynopsis|destructorsynopsis|methodsynopsis">
952 <xsl:variable name=
"start-modifiers" select=
"modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
953 <xsl:variable name=
"notmod" select=
"*[local-name(.) != 'modifier']"/>
954 <xsl:variable name=
"end-modifiers" select=
"modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
955 <xsl:variable name=
"decl">
956 <xsl:if test=
"parent::classsynopsis">
957 <xsl:text> </xsl:text>
959 <xsl:apply-templates select=
"$start-modifiers" mode=
"java"/>
962 <xsl:if test=
"local-name($notmod[1]) != 'methodname'">
963 <xsl:apply-templates select=
"$notmod[1]" mode=
"java"/>
966 <xsl:apply-templates select=
"methodname" mode=
"java"/>
970 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
971 <xsl:copy-of select=
"$decl"/>
972 <xsl:text>(
</xsl:text>
973 <xsl:apply-templates select=
"methodparam" mode=
"java">
974 <xsl:with-param name=
"indent" select=
"string-length($decl)"/>
975 </xsl:apply-templates>
976 <xsl:text>)
</xsl:text>
977 <xsl:if test=
"exceptionname">
981 <xsl:text> throws
</xsl:text>
982 <xsl:apply-templates select=
"exceptionname" mode=
"java"/>
984 <xsl:if test=
"modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
985 <xsl:text> </xsl:text>
986 <xsl:apply-templates select=
"$end-modifiers" mode=
"java"/>
988 <xsl:text>;
</xsl:text>
990 <xsl:call-template name=
"synop-break"/>
993 <!-- ===== C++ ========================================================= -->
995 <xsl:template match=
"classsynopsis" mode=
"cpp">
997 </xsl:text><xsl:text>⌂nf
999 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1000 <xsl:apply-templates select=
"ooclass[1]" mode=
"cpp"/>
1001 <xsl:if test=
"ooclass[preceding-sibling::*]">
1002 <xsl:text>:
</xsl:text>
1003 <xsl:apply-templates select=
"ooclass[preceding-sibling::*]" mode=
"cpp"/>
1004 <xsl:if test=
"oointerface|ooexception">
1008 <xsl:text> </xsl:text>
1011 <xsl:if test=
"oointerface">
1012 <xsl:text> implements
</xsl:text>
1013 <xsl:apply-templates select=
"oointerface" mode=
"cpp"/>
1014 <xsl:if test=
"ooexception">
1018 <xsl:text> </xsl:text>
1021 <xsl:if test=
"ooexception">
1022 <xsl:text> throws
</xsl:text>
1023 <xsl:apply-templates select=
"ooexception" mode=
"cpp"/>
1025 <xsl:text> {
</xsl:text>
1029 <xsl:apply-templates select=
"constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode=
"cpp"/>
1030 <xsl:text>}
</xsl:text>
1031 </pre><xsl:text/><xsl:text>⌂fi
1035 <xsl:template match=
"classsynopsisinfo" mode=
"cpp">
1036 <xsl:apply-templates mode=
"cpp"/>
1039 <xsl:template match=
"ooclass|oointerface|ooexception" mode=
"cpp">
1040 <xsl:if test=
"preceding-sibling::*">
1041 <xsl:text>,
</xsl:text>
1044 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1045 <xsl:apply-templates mode=
"cpp"/>
1049 <xsl:template match=
"modifier|package" mode=
"cpp">
1051 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1052 <xsl:apply-templates mode=
"cpp"/>
1053 <xsl:if test=
"following-sibling::*">
1054 <xsl:text> </xsl:text>
1059 <xsl:template match=
"classname" mode=
"cpp">
1060 <xsl:if test=
"local-name(preceding-sibling::*[1]) = 'classname'">
1061 <xsl:text>,
</xsl:text>
1064 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1065 <xsl:apply-templates mode=
"cpp"/>
1069 <xsl:template match=
"interfacename" mode=
"cpp">
1070 <xsl:if test=
"local-name(preceding-sibling::*[1]) = 'interfacename'">
1071 <xsl:text>,
</xsl:text>
1074 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1075 <xsl:apply-templates mode=
"cpp"/>
1079 <xsl:template match=
"exceptionname" mode=
"cpp">
1080 <xsl:if test=
"local-name(preceding-sibling::*[1]) = 'exceptionname'">
1081 <xsl:text>,
</xsl:text>
1084 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1085 <xsl:apply-templates mode=
"cpp"/>
1089 <xsl:template match=
"fieldsynopsis" mode=
"cpp">
1091 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1092 <xsl:if test=
"parent::classsynopsis">
1093 <xsl:text> </xsl:text>
1095 <xsl:apply-templates mode=
"cpp"/>
1096 <xsl:text>;
</xsl:text>
1098 <xsl:call-template name=
"synop-break"/>
1101 <xsl:template match=
"type" mode=
"cpp">
1103 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1104 <xsl:apply-templates mode=
"cpp"/>
1105 <xsl:text> </xsl:text>
1109 <xsl:template match=
"varname" mode=
"cpp">
1111 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1112 <xsl:apply-templates mode=
"cpp"/>
1113 <xsl:text> </xsl:text>
1117 <xsl:template match=
"initializer" mode=
"cpp">
1119 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1120 <xsl:text>=
</xsl:text>
1121 <xsl:apply-templates mode=
"cpp"/>
1125 <xsl:template match=
"void" mode=
"cpp">
1127 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1128 <xsl:text>void
</xsl:text>
1132 <xsl:template match=
"methodname" mode=
"cpp">
1134 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1135 <xsl:apply-templates mode=
"cpp"/>
1139 <xsl:template match=
"methodparam" mode=
"cpp">
1140 <xsl:if test=
"preceding-sibling::methodparam">
1141 <xsl:text>,
</xsl:text>
1144 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1145 <xsl:apply-templates mode=
"cpp"/>
1149 <xsl:template match=
"parameter" mode=
"cpp">
1151 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1152 <xsl:apply-templates mode=
"cpp"/>
1156 <xsl:template mode=
"cpp" match=
"constructorsynopsis|destructorsynopsis|methodsynopsis">
1157 <xsl:variable name=
"start-modifiers" select=
"modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
1158 <xsl:variable name=
"notmod" select=
"*[local-name(.) != 'modifier']"/>
1159 <xsl:variable name=
"end-modifiers" select=
"modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
1162 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1163 <xsl:if test=
"parent::classsynopsis">
1164 <xsl:text> </xsl:text>
1166 <xsl:apply-templates select=
"$start-modifiers" mode=
"cpp"/>
1169 <xsl:if test=
"local-name($notmod[1]) != 'methodname'">
1170 <xsl:apply-templates select=
"$notmod[1]" mode=
"cpp"/>
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">
1181 <xsl:text> throws
</xsl:text>
1182 <xsl:apply-templates select=
"exceptionname" mode=
"cpp"/>
1184 <xsl:if test=
"modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
1185 <xsl:text> </xsl:text>
1186 <xsl:apply-templates select=
"$end-modifiers" mode=
"cpp"/>
1188 <xsl:text>;
</xsl:text>
1190 <xsl:call-template name=
"synop-break"/>
1193 <!-- ===== IDL ========================================================= -->
1195 <xsl:template match=
"classsynopsis" mode=
"idl">
1197 </xsl:text><xsl:text>⌂nf
1199 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1200 <xsl:text>interface
</xsl:text>
1201 <xsl:apply-templates select=
"ooclass[1]" mode=
"idl"/>
1202 <xsl:if test=
"ooclass[preceding-sibling::*]">
1203 <xsl:text>:
</xsl:text>
1204 <xsl:apply-templates select=
"ooclass[preceding-sibling::*]" mode=
"idl"/>
1205 <xsl:if test=
"oointerface|ooexception">
1209 <xsl:text> </xsl:text>
1212 <xsl:if test=
"oointerface">
1213 <xsl:text> implements
</xsl:text>
1214 <xsl:apply-templates select=
"oointerface" mode=
"idl"/>
1215 <xsl:if test=
"ooexception">
1219 <xsl:text> </xsl:text>
1222 <xsl:if test=
"ooexception">
1223 <xsl:text> throws
</xsl:text>
1224 <xsl:apply-templates select=
"ooexception" mode=
"idl"/>
1226 <xsl:text> {
</xsl:text>
1230 <xsl:apply-templates select=
"constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode=
"idl"/>
1231 <xsl:text>}
</xsl:text>
1232 </pre><xsl:text/><xsl:text>⌂fi
1236 <xsl:template match=
"classsynopsisinfo" mode=
"idl">
1237 <xsl:apply-templates mode=
"idl"/>
1240 <xsl:template match=
"ooclass|oointerface|ooexception" mode=
"idl">
1241 <xsl:if test=
"preceding-sibling::*">
1242 <xsl:text>,
</xsl:text>
1245 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1246 <xsl:apply-templates mode=
"idl"/>
1250 <xsl:template match=
"modifier|package" mode=
"idl">
1252 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1253 <xsl:apply-templates mode=
"idl"/>
1254 <xsl:if test=
"following-sibling::*">
1255 <xsl:text> </xsl:text>
1260 <xsl:template match=
"classname" mode=
"idl">
1261 <xsl:if test=
"local-name(preceding-sibling::*[1]) = 'classname'">
1262 <xsl:text>,
</xsl:text>
1265 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1266 <xsl:apply-templates mode=
"idl"/>
1270 <xsl:template match=
"interfacename" mode=
"idl">
1271 <xsl:if test=
"local-name(preceding-sibling::*[1]) = 'interfacename'">
1272 <xsl:text>,
</xsl:text>
1275 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1276 <xsl:apply-templates mode=
"idl"/>
1280 <xsl:template match=
"exceptionname" mode=
"idl">
1281 <xsl:if test=
"local-name(preceding-sibling::*[1]) = 'exceptionname'">
1282 <xsl:text>,
</xsl:text>
1285 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1286 <xsl:apply-templates mode=
"idl"/>
1290 <xsl:template match=
"fieldsynopsis" mode=
"idl">
1292 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1293 <xsl:if test=
"parent::classsynopsis">
1294 <xsl:text> </xsl:text>
1296 <xsl:apply-templates mode=
"idl"/>
1297 <xsl:text>;
</xsl:text>
1299 <xsl:call-template name=
"synop-break"/>
1302 <xsl:template match=
"type" mode=
"idl">
1304 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1305 <xsl:apply-templates mode=
"idl"/>
1306 <xsl:text> </xsl:text>
1310 <xsl:template match=
"varname" mode=
"idl">
1312 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1313 <xsl:apply-templates mode=
"idl"/>
1314 <xsl:text> </xsl:text>
1318 <xsl:template match=
"initializer" mode=
"idl">
1320 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1321 <xsl:text>=
</xsl:text>
1322 <xsl:apply-templates mode=
"idl"/>
1326 <xsl:template match=
"void" mode=
"idl">
1328 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1329 <xsl:text>void
</xsl:text>
1333 <xsl:template match=
"methodname" mode=
"idl">
1335 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1336 <xsl:apply-templates mode=
"idl"/>
1340 <xsl:template match=
"methodparam" mode=
"idl">
1341 <xsl:if test=
"preceding-sibling::methodparam">
1342 <xsl:text>,
</xsl:text>
1345 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1346 <xsl:apply-templates mode=
"idl"/>
1350 <xsl:template match=
"parameter" mode=
"idl">
1352 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1353 <xsl:apply-templates mode=
"idl"/>
1357 <xsl:template mode=
"idl" match=
"constructorsynopsis|destructorsynopsis|methodsynopsis">
1358 <xsl:variable name=
"start-modifiers" select=
"modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
1359 <xsl:variable name=
"notmod" select=
"*[local-name(.) != 'modifier']"/>
1360 <xsl:variable name=
"end-modifiers" select=
"modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
1362 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1363 <xsl:if test=
"parent::classsynopsis">
1364 <xsl:text> </xsl:text>
1366 <xsl:apply-templates select=
"$start-modifiers" mode=
"idl"/>
1369 <xsl:if test=
"local-name($notmod[1]) != 'methodname'">
1370 <xsl:apply-templates select=
"$notmod[1]" mode=
"idl"/>
1373 <xsl:apply-templates select=
"methodname" mode=
"idl"/>
1374 <xsl:text>(
</xsl:text>
1375 <xsl:apply-templates select=
"methodparam" mode=
"idl"/>
1376 <xsl:text>)
</xsl:text>
1377 <xsl:if test=
"exceptionname">
1381 <xsl:text> raises(
</xsl:text>
1382 <xsl:apply-templates select=
"exceptionname" mode=
"idl"/>
1383 <xsl:text>)
</xsl:text>
1385 <xsl:if test=
"modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
1386 <xsl:text> </xsl:text>
1387 <xsl:apply-templates select=
"$end-modifiers" mode=
"idl"/>
1389 <xsl:text>;
</xsl:text>
1391 <xsl:call-template name=
"synop-break"/>
1394 <!-- ===== Perl ======================================================== -->
1396 <xsl:template match=
"classsynopsis" mode=
"perl">
1398 </xsl:text><xsl:text>⌂nf
1400 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1401 <xsl:text>package
</xsl:text>
1402 <xsl:apply-templates select=
"ooclass[1]" mode=
"perl"/>
1403 <xsl:text>;
</xsl:text>
1408 <xsl:if test=
"ooclass[preceding-sibling::*]">
1409 <xsl:text>@ISA = (
</xsl:text>
1410 <xsl:apply-templates select=
"ooclass[preceding-sibling::*]" mode=
"perl"/>
1411 <xsl:text>);
</xsl:text>
1417 <xsl:apply-templates select=
"constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode=
"perl"/>
1418 </pre><xsl:text/><xsl:text>⌂fi
1422 <xsl:template match=
"classsynopsisinfo" mode=
"perl">
1423 <xsl:apply-templates mode=
"perl"/>
1426 <xsl:template match=
"ooclass|oointerface|ooexception" mode=
"perl">
1427 <xsl:if test=
"preceding-sibling::*">
1428 <xsl:text>,
</xsl:text>
1431 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1432 <xsl:apply-templates mode=
"perl"/>
1436 <xsl:template match=
"modifier|package" mode=
"perl">
1438 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1439 <xsl:apply-templates mode=
"perl"/>
1440 <xsl:if test=
"following-sibling::*">
1441 <xsl:text> </xsl:text>
1446 <xsl:template match=
"classname" mode=
"perl">
1447 <xsl:if test=
"local-name(preceding-sibling::*[1]) = 'classname'">
1448 <xsl:text>,
</xsl:text>
1451 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1452 <xsl:apply-templates mode=
"perl"/>
1456 <xsl:template match=
"interfacename" mode=
"perl">
1457 <xsl:if test=
"local-name(preceding-sibling::*[1]) = 'interfacename'">
1458 <xsl:text>,
</xsl:text>
1461 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1462 <xsl:apply-templates mode=
"perl"/>
1466 <xsl:template match=
"exceptionname" mode=
"perl">
1467 <xsl:if test=
"local-name(preceding-sibling::*[1]) = 'exceptionname'">
1468 <xsl:text>,
</xsl:text>
1471 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1472 <xsl:apply-templates mode=
"perl"/>
1476 <xsl:template match=
"fieldsynopsis" mode=
"perl">
1478 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1479 <xsl:if test=
"parent::classsynopsis">
1480 <xsl:text> </xsl:text>
1482 <xsl:apply-templates mode=
"perl"/>
1483 <xsl:text>;
</xsl:text>
1485 <xsl:call-template name=
"synop-break"/>
1488 <xsl:template match=
"type" mode=
"perl">
1490 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1491 <xsl:apply-templates mode=
"perl"/>
1492 <xsl:text> </xsl:text>
1496 <xsl:template match=
"varname" mode=
"perl">
1498 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1499 <xsl:apply-templates mode=
"perl"/>
1500 <xsl:text> </xsl:text>
1504 <xsl:template match=
"initializer" mode=
"perl">
1506 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1507 <xsl:text>=
</xsl:text>
1508 <xsl:apply-templates mode=
"perl"/>
1512 <xsl:template match=
"void" mode=
"perl">
1514 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1515 <xsl:text>void
</xsl:text>
1519 <xsl:template match=
"methodname" mode=
"perl">
1521 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1522 <xsl:apply-templates mode=
"perl"/>
1526 <xsl:template match=
"methodparam" mode=
"perl">
1527 <xsl:if test=
"preceding-sibling::methodparam">
1528 <xsl:text>,
</xsl:text>
1531 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1532 <xsl:apply-templates mode=
"perl"/>
1536 <xsl:template match=
"parameter" mode=
"perl">
1538 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1539 <xsl:apply-templates mode=
"perl"/>
1543 <xsl:template mode=
"perl" match=
"constructorsynopsis|destructorsynopsis|methodsynopsis">
1544 <xsl:variable name=
"start-modifiers" select=
"modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
1545 <xsl:variable name=
"notmod" select=
"*[local-name(.) != 'modifier']"/>
1546 <xsl:variable name=
"end-modifiers" select=
"modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
1549 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
1550 <xsl:text>sub
</xsl:text>
1552 <xsl:apply-templates select=
"methodname" mode=
"perl"/>
1553 <xsl:text> { ... };
</xsl:text>
1555 <xsl:call-template name=
"synop-break"/>
1558 <!-- ==================================================================== -->
1560 <!-- * DocBook 5 allows linking elements (link, olink, and xref) -->
1561 <!-- * within the OO *synopsis elements (classsynopsis, fieldsynopsis, -->
1562 <!-- * methodsynopsis, constructorsynopsis, destructorsynopsis) and -->
1563 <!-- * their children. So we need to have mode="java|cpp|idl|perl" -->
1564 <!-- * per-mode matches for those linking elements in order for them -->
1565 <!-- * to be processed as expected. -->
1567 <xsl:template match=
"link|olink|xref" mode=
"java">
1568 <xsl:apply-templates select=
"."/>
1571 <xsl:template match=
"link|olink|xref" mode=
"cpp">
1572 <xsl:apply-templates select=
"."/>
1575 <xsl:template match=
"link|olink|xref" mode=
"idl">
1576 <xsl:apply-templates select=
"."/>
1579 <xsl:template match=
"link|olink|xref" mode=
"perl">
1580 <xsl:apply-templates select=
"."/>