1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531 |
- <?xml version="1.0" encoding="US-ASCII"?>
- <!--This file was created automatically by html2xhtml-->
- <!--from the HTML stylesheets. Do not edit this file.-->
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
- <!-- ********************************************************************
- $Id$
- ********************************************************************
- This file is part of the XSL DocBook Stylesheet distribution.
- See ../README or http://nwalsh.com/docbook/xsl/ for copyright
- and other information.
- ******************************************************************** -->
- <!-- ==================================================================== -->
- <!-- synopsis is in verbatim -->
- <!-- ==================================================================== -->
- <xsl:template match="cmdsynopsis">
- <div>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <p>
- <xsl:call-template name="anchor"/>
- <xsl:apply-templates/>
- </p>
- </div>
- </xsl:template>
- <xsl:template match="cmdsynopsis/command">
- <br/>
- <xsl:call-template name="inline.monoseq"/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <xsl:template match="cmdsynopsis/command[1]" priority="2">
- <xsl:call-template name="inline.monoseq"/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <xsl:template match="group|arg" name="group-or-arg">
- <xsl:variable name="choice" select="@choice"/>
- <xsl:variable name="rep" select="@rep"/>
- <xsl:variable name="sepchar">
- <xsl:choose>
- <xsl:when test="ancestor-or-self::*/@sepchar">
- <xsl:value-of select="ancestor-or-self::*/@sepchar"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="preceding-sibling::*">
- <xsl:value-of select="$sepchar"/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$choice='plain'">
- <xsl:value-of select="$arg.choice.plain.open.str"/>
- </xsl:when>
- <xsl:when test="$choice='req'">
- <xsl:value-of select="$arg.choice.req.open.str"/>
- </xsl:when>
- <xsl:when test="$choice='opt'">
- <xsl:value-of select="$arg.choice.opt.open.str"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$arg.choice.def.open.str"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates/>
- <xsl:choose>
- <xsl:when test="$rep='repeat'">
- <xsl:value-of select="$arg.rep.repeat.str"/>
- </xsl:when>
- <xsl:when test="$rep='norepeat'">
- <xsl:value-of select="$arg.rep.norepeat.str"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$arg.rep.def.str"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="$choice='plain'">
- <xsl:value-of select="$arg.choice.plain.close.str"/>
- </xsl:when>
- <xsl:when test="$choice='req'">
- <xsl:value-of select="$arg.choice.req.close.str"/>
- </xsl:when>
- <xsl:when test="$choice='opt'">
- <xsl:value-of select="$arg.choice.opt.close.str"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$arg.choice.def.close.str"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="group/arg">
- <xsl:variable name="choice" select="@choice"/>
- <xsl:variable name="rep" select="@rep"/>
- <xsl:if test="preceding-sibling::*">
- <xsl:value-of select="$arg.or.sep"/>
- </xsl:if>
- <xsl:call-template name="group-or-arg"/>
- </xsl:template>
- <xsl:template match="sbr">
- <br/>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="synopfragmentref">
- <xsl:variable name="target" select="key('id',@linkend)"/>
- <xsl:variable name="snum">
- <xsl:apply-templates select="$target" mode="synopfragment.number"/>
- </xsl:variable>
- <i>
- <a href="#{@linkend}">
- <xsl:text>(</xsl:text>
- <xsl:value-of select="$snum"/>
- <xsl:text>)</xsl:text>
- </a>
- <xsl:text> </xsl:text>
- <xsl:apply-templates/>
- </i>
- </xsl:template>
- <xsl:template match="synopfragment" mode="synopfragment.number">
- <xsl:number format="1"/>
- </xsl:template>
- <xsl:template match="synopfragment">
- <xsl:variable name="snum">
- <xsl:apply-templates select="." mode="synopfragment.number"/>
- </xsl:variable>
- <p>
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
- <a id="{$id}">
- <xsl:text>(</xsl:text>
- <xsl:value-of select="$snum"/>
- <xsl:text>)</xsl:text>
- </a>
- <xsl:text> </xsl:text>
- <xsl:apply-templates/>
- </p>
- </xsl:template>
- <xsl:template match="funcsynopsis">
- <xsl:call-template name="informal.object"/>
- </xsl:template>
- <xsl:template match="funcsynopsisinfo">
- <pre>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates/>
- </pre>
- </xsl:template>
- <!-- ====================================================================== -->
- <!-- funcprototype -->
- <!--
- funcprototype ::= (funcdef,
- (void|varargs|paramdef+))
- funcdef ::= (#PCDATA|type|replaceable|function)*
- paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
- -->
- <xsl:template match="funcprototype">
- <xsl:variable name="html-style">
- <xsl:call-template name="dbhtml-attribute">
- <xsl:with-param name="pis" select="ancestor::funcsynopsis//processing-instruction('dbhtml')"/>
- <xsl:with-param name="attribute" select="'funcsynopsis-style'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="style">
- <xsl:choose>
- <xsl:when test="$html-style != ''">
- <xsl:value-of select="$html-style"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$funcsynopsis.style"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!--
- <xsl:variable name="tabular-p"
- select="$funcsynopsis.tabular.threshold > 0
- and string-length(.) > $funcsynopsis.tabular.threshold"/>
- -->
- <xsl:variable name="tabular-p" select="true()"/>
- <xsl:choose>
- <xsl:when test="$style = 'kr' and $tabular-p">
- <xsl:apply-templates select="." mode="kr-tabular"/>
- </xsl:when>
- <xsl:when test="$style = 'kr'">
- <xsl:apply-templates select="." mode="kr-nontabular"/>
- </xsl:when>
- <xsl:when test="$style = 'ansi' and $tabular-p">
- <xsl:apply-templates select="." mode="ansi-tabular"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="ansi-nontabular"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ====================================================================== -->
- <!-- funcprototype: kr, non-tabular -->
- <xsl:template match="funcprototype" mode="kr-nontabular">
- <p>
- <xsl:apply-templates mode="kr-nontabular"/>
- <xsl:if test="paramdef">
- <br/>
- <xsl:apply-templates select="paramdef" mode="kr-funcsynopsis-mode"/>
- </xsl:if>
- </p>
- </xsl:template>
- <xsl:template match="funcdef" mode="kr-nontabular">
- <code>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="kr-nontabular"/>
- <xsl:text>(</xsl:text>
- </code>
- </xsl:template>
- <xsl:template match="funcdef/function" mode="kr-nontabular">
- <xsl:choose>
- <xsl:when test="$funcsynopsis.decoration != 0">
- <b class="fsfunc"><xsl:apply-templates mode="kr-nontabular"/></b>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="kr-nontabular"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="void" mode="kr-nontabular">
- <code>)</code>
- <xsl:text>;</xsl:text>
- </xsl:template>
- <xsl:template match="varargs" mode="kr-nontabular">
- <xsl:text>...</xsl:text>
- <code>)</code>
- <xsl:text>;</xsl:text>
- </xsl:template>
- <xsl:template match="paramdef" mode="kr-nontabular">
- <xsl:apply-templates select="parameter" mode="kr-nontabular"/>
- <xsl:choose>
- <xsl:when test="following-sibling::*">
- <xsl:text>, </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <code>)</code>
- <xsl:text>;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="paramdef/parameter" mode="kr-nontabular">
- <xsl:choose>
- <xsl:when test="$funcsynopsis.decoration != 0">
- <var class="pdparam">
- <xsl:apply-templates mode="kr-nontabular"/>
- </var>
- </xsl:when>
- <xsl:otherwise>
- <code>
- <xsl:apply-templates mode="kr-nontabular"/>
- </code>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="paramdef" mode="kr-funcsynopsis-mode">
- <xsl:if test="preceding-sibling::paramdef"><br/></xsl:if>
- <code>
- <xsl:apply-templates mode="kr-funcsynopsis-mode"/>
- </code>
- <xsl:text>;</xsl:text>
- </xsl:template>
- <xsl:template match="paramdef/parameter" mode="kr-funcsynopsis-mode">
- <xsl:choose>
- <xsl:when test="$funcsynopsis.decoration != 0">
- <var class="pdparam">
- <xsl:apply-templates mode="kr-funcsynopsis-mode"/>
- </var>
- </xsl:when>
- <xsl:otherwise>
- <code>
- <xsl:apply-templates mode="kr-funcsynopsis-mode"/>
- </code>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="funcparams" mode="kr-funcsynopsis-mode">
- <code>(</code>
- <xsl:apply-templates mode="kr-funcsynopsis-mode"/>
- <code>)</code>
- </xsl:template>
- <!-- ====================================================================== -->
- <!-- funcprototype: kr, tabular -->
- <xsl:template match="funcprototype" mode="kr-tabular">
- <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
- <tr>
- <td>
- <xsl:apply-templates select="funcdef" mode="kr-tabular"/>
- </td>
- <xsl:apply-templates select="(void|varargs|paramdef)[1]" mode="kr-tabular"/>
- </tr>
- <xsl:for-each select="(void|varargs|paramdef)[preceding-sibling::*[not(self::funcdef)]]">
- <tr>
- <td> </td>
- <xsl:apply-templates select="." mode="kr-tabular"/>
- </tr>
- </xsl:for-each>
- </table>
- <xsl:if test="paramdef">
- <table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0">
- <xsl:if test="following-sibling::funcprototype">
- <xsl:attribute name="style">padding-bottom: 1em</xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="paramdef" mode="kr-tabular-funcsynopsis-mode"/>
- </table>
- </xsl:if>
- </xsl:template>
- <xsl:template match="funcdef" mode="kr-tabular">
- <code>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="kr-tabular"/>
- <xsl:text>(</xsl:text>
- </code>
- </xsl:template>
- <xsl:template match="funcdef/function" mode="kr-tabular">
- <xsl:choose>
- <xsl:when test="$funcsynopsis.decoration != 0">
- <b class="fsfunc"><xsl:apply-templates mode="kr-nontabular"/></b>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="kr-tabular"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="void" mode="kr-tabular">
- <td>
- <code>)</code>
- <xsl:text>;</xsl:text>
- </td>
- <td> </td>
- </xsl:template>
- <xsl:template match="varargs" mode="kr-tabular">
- <td>
- <xsl:text>...</xsl:text>
- <code>)</code>
- <xsl:text>;</xsl:text>
- </td>
- <td> </td>
- </xsl:template>
- <xsl:template match="paramdef" mode="kr-tabular">
- <td>
- <xsl:apply-templates select="parameter" mode="kr-tabular"/>
- <xsl:choose>
- <xsl:when test="following-sibling::*">
- <xsl:text>, </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <code>)</code>
- <xsl:text>;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- <td> </td>
- </xsl:template>
- <xsl:template match="paramdef/parameter" mode="kr-tabular">
- <xsl:choose>
- <xsl:when test="$funcsynopsis.decoration != 0">
- <var class="pdparam">
- <xsl:apply-templates mode="kr-tabular"/>
- </var>
- </xsl:when>
- <xsl:otherwise>
- <code>
- <xsl:apply-templates mode="kr-tabular"/>
- </code>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="paramdef" mode="kr-tabular-funcsynopsis-mode">
- <xsl:variable name="type">
- <xsl:choose>
- <xsl:when test="type">
- <xsl:apply-templates select="type" mode="kr-tabular-funcsynopsis-mode"/>
- </xsl:when>
- <xsl:when test="normalize-space(parameter/preceding-sibling::node()[not(self::parameter)]) != ''">
- <xsl:copy-of select="parameter/preceding-sibling::node()[not(self::parameter)]"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <tr>
- <xsl:choose>
- <xsl:when test="$type != '' and funcparams">
- <td>
- <code>
- <xsl:copy-of select="$type"/>
- </code>
- <xsl:text> </xsl:text>
- </td>
- <td>
- <code>
- <xsl:choose>
- <xsl:when test="type">
- <xsl:apply-templates select="type/following-sibling::*" mode="kr-tabular-funcsynopsis-mode"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="*" mode="kr-tabular-funcsynopsis-mode"/>
- </xsl:otherwise>
- </xsl:choose>
- </code>
- </td>
- </xsl:when>
- <xsl:when test="funcparams">
- <td colspan="2">
- <code>
- <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/>
- </code>
- </td>
- </xsl:when>
- <xsl:otherwise>
- <td>
- <code>
- <xsl:apply-templates select="parameter/preceding-sibling::node()[not(self::parameter)]" mode="kr-tabular-funcsynopsis-mode"/>
- </code>
- <xsl:text> </xsl:text>
- </td>
- <td>
- <code>
- <xsl:apply-templates select="parameter" mode="kr-tabular"/>
- <xsl:apply-templates select="parameter/following-sibling::*[not(self::parameter)]" mode="kr-tabular-funcsynopsis-mode"/>
- <xsl:text>;</xsl:text>
- </code>
- </td>
- </xsl:otherwise>
- </xsl:choose>
- </tr>
- </xsl:template>
- <xsl:template match="paramdef/parameter" mode="kr-tabular-funcsynopsis-mode">
- <xsl:choose>
- <xsl:when test="$funcsynopsis.decoration != 0">
- <var class="pdparam">
- <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/>
- </var>
- </xsl:when>
- <xsl:otherwise>
- <code>
- <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/>
- </code>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="funcparams" mode="kr-tabular-funcsynopsis-mode">
- <code>(</code>
- <xsl:apply-templates mode="kr-tabular-funcsynopsis-mode"/>
- <code>)</code>
- <xsl:text>;</xsl:text>
- </xsl:template>
- <!-- ====================================================================== -->
- <!-- funcprototype: ansi, non-tabular -->
- <xsl:template match="funcprototype" mode="ansi-nontabular">
- <p>
- <xsl:apply-templates mode="ansi-nontabular"/>
- </p>
- </xsl:template>
- <xsl:template match="funcdef" mode="ansi-nontabular">
- <code>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="ansi-nontabular"/>
- <xsl:text>(</xsl:text>
- </code>
- </xsl:template>
- <xsl:template match="funcdef/function" mode="ansi-nontabular">
- <xsl:choose>
- <xsl:when test="$funcsynopsis.decoration != 0">
- <b class="fsfunc"><xsl:apply-templates mode="ansi-nontabular"/></b>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="ansi-nontabular"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="void" mode="ansi-nontabular">
- <code>void)</code>
- <xsl:text>;</xsl:text>
- </xsl:template>
- <xsl:template match="varargs" mode="ansi-nontabular">
- <xsl:text>...</xsl:text>
- <code>)</code>
- <xsl:text>;</xsl:text>
- </xsl:template>
- <xsl:template match="paramdef" mode="ansi-nontabular">
- <xsl:apply-templates mode="ansi-nontabular"/>
- <xsl:choose>
- <xsl:when test="following-sibling::*">
- <xsl:text>, </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <code>)</code>
- <xsl:text>;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="paramdef/parameter" mode="ansi-nontabular">
- <xsl:choose>
- <xsl:when test="$funcsynopsis.decoration != 0">
- <var class="pdparam">
- <xsl:apply-templates mode="ansi-nontabular"/>
- </var>
- </xsl:when>
- <xsl:otherwise>
- <code>
- <xsl:apply-templates mode="ansi-nontabular"/>
- </code>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="funcparams" mode="ansi-nontabular">
- <code>(</code>
- <xsl:apply-templates mode="ansi-nontabular"/>
- <code>)</code>
- </xsl:template>
- <!-- ====================================================================== -->
- <!-- funcprototype: ansi, tabular -->
- <xsl:template match="funcprototype" mode="ansi-tabular">
- <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
- <xsl:if test="following-sibling::funcprototype">
- <xsl:attribute name="style">padding-bottom: 1em</xsl:attribute>
- </xsl:if>
- <tr>
- <td>
- <xsl:apply-templates select="funcdef" mode="ansi-tabular"/>
- </td>
- <xsl:apply-templates select="(void|varargs|paramdef)[1]" mode="ansi-tabular"/>
- </tr>
- <xsl:for-each select="(void|varargs|paramdef)[preceding-sibling::*[not(self::funcdef)]]">
- <tr>
- <td> </td>
- <xsl:apply-templates select="." mode="ansi-tabular"/>
- </tr>
- </xsl:for-each>
- </table>
- </xsl:template>
- <xsl:template match="funcdef" mode="ansi-tabular">
- <code>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="ansi-tabular"/>
- <xsl:text>(</xsl:text>
- </code>
- </xsl:template>
- <xsl:template match="funcdef/function" mode="ansi-tabular">
- <xsl:choose>
- <xsl:when test="$funcsynopsis.decoration != 0">
- <b class="fsfunc"><xsl:apply-templates mode="ansi-nontabular"/></b>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="kr-tabular"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="void" mode="ansi-tabular">
- <td>
- <code>void)</code>
- <xsl:text>;</xsl:text>
- </td>
- <td> </td>
- </xsl:template>
- <xsl:template match="varargs" mode="ansi-tabular">
- <td>
- <xsl:text>...</xsl:text>
- <code>)</code>
- <xsl:text>;</xsl:text>
- </td>
- <td> </td>
- </xsl:template>
- <xsl:template match="paramdef" mode="ansi-tabular">
- <xsl:variable name="type">
- <xsl:choose>
- <xsl:when test="type">
- <xsl:apply-templates select="type" mode="ansi-tabular"/>
- </xsl:when>
- <xsl:when test="normalize-space(parameter/preceding-sibling::node()[not(self::parameter)]) != ''">
- <xsl:copy-of select="parameter/preceding-sibling::node()[not(self::parameter)]"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$type != '' and funcparams">
- <td>
- <xsl:copy-of select="$type"/>
- <xsl:text> </xsl:text>
- </td>
- <td>
- <xsl:choose>
- <xsl:when test="type">
- <xsl:apply-templates select="type/following-sibling::*" mode="ansi-tabular"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="*" mode="ansi-tabular"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="following-sibling::*">
- <xsl:text>, </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <code>)</code>
- <xsl:text>;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </xsl:when>
- <xsl:otherwise>
- <td>
- <xsl:apply-templates select="parameter/preceding-sibling::node()[not(self::parameter)]" mode="ansi-tabular"/>
- <xsl:text> </xsl:text>
- </td>
- <td>
- <xsl:apply-templates select="parameter" mode="ansi-tabular"/>
- <xsl:apply-templates select="parameter/following-sibling::*[not(self::parameter)]" mode="ansi-tabular"/>
- <xsl:choose>
- <xsl:when test="following-sibling::*">
- <xsl:text>, </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <code>)</code>
- <xsl:text>;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="paramdef/parameter" mode="ansi-tabular">
- <xsl:choose>
- <xsl:when test="$funcsynopsis.decoration != 0">
- <var class="pdparam">
- <xsl:apply-templates mode="ansi-tabular"/>
- </var>
- </xsl:when>
- <xsl:otherwise>
- <code>
- <xsl:apply-templates mode="ansi-tabular"/>
- </code>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="funcparams" mode="ansi-tabular">
- <code>(</code>
- <xsl:apply-templates/>
- <code>)</code>
- </xsl:template>
- <!-- ====================================================================== -->
- <xsl:variable name="default-classsynopsis-language">java</xsl:variable>
- <xsl:template match="classsynopsis |fieldsynopsis |methodsynopsis |constructorsynopsis |destructorsynopsis">
- <xsl:param name="language">
- <xsl:choose>
- <xsl:when test="@language">
- <xsl:value-of select="@language"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$default-classsynopsis-language"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:param>
- <xsl:choose>
- <xsl:when test="$language='java' or $language='Java'">
- <xsl:apply-templates select="." mode="java"/>
- </xsl:when>
- <xsl:when test="$language='perl' or $language='Perl'">
- <xsl:apply-templates select="." mode="perl"/>
- </xsl:when>
- <xsl:when test="$language='idl' or $language='IDL'">
- <xsl:apply-templates select="." mode="idl"/>
- </xsl:when>
- <xsl:when test="$language='cpp' or $language='c++' or $language='C++'">
- <xsl:apply-templates select="." mode="cpp"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>
- <xsl:text>Unrecognized language on </xsl:text>
- <xsl:value-of select="local-name(.)"/>
- <xsl:text>: </xsl:text>
- <xsl:value-of select="$language"/>
- </xsl:message>
- <xsl:apply-templates select=".">
- <xsl:with-param name="language" select="$default-classsynopsis-language"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="synop-break">
- <xsl:if test="parent::classsynopsis or (following-sibling::fieldsynopsis |following-sibling::methodsynopsis |following-sibling::constructorsynopsis |following-sibling::destructorsynopsis)">
- <br/>
- </xsl:if>
- </xsl:template>
- <!-- ===== Java ======================================================== -->
- <xsl:template match="classsynopsis" mode="java">
- <pre>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates select="ooclass[1]" mode="java"/>
- <xsl:if test="ooclass[preceding-sibling::*]">
- <xsl:text> extends</xsl:text>
- <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="java"/>
- <xsl:if test="oointerface|ooexception">
- <br/>
- <xsl:text>    </xsl:text>
- </xsl:if>
- </xsl:if>
- <xsl:if test="oointerface">
- <xsl:text>implements</xsl:text>
- <xsl:apply-templates select="oointerface" mode="java"/>
- <xsl:if test="ooexception">
- <br/>
- <xsl:text>    </xsl:text>
- </xsl:if>
- </xsl:if>
- <xsl:if test="ooexception">
- <xsl:text>throws</xsl:text>
- <xsl:apply-templates select="ooexception" mode="java"/>
- </xsl:if>
- <xsl:text> {</xsl:text>
- <br/>
- <xsl:apply-templates select="constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode="java"/>
- <xsl:text>}</xsl:text>
- </pre>
- </xsl:template>
- <xsl:template match="classsynopsisinfo" mode="java">
- <xsl:apply-templates mode="java"/>
- </xsl:template>
- <xsl:template match="ooclass|oointerface|ooexception" mode="java">
- <xsl:choose>
- <xsl:when test="preceding-sibling::*">
- <xsl:text>, </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text> </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="java"/>
- </span>
- </xsl:template>
- <xsl:template match="modifier|package" mode="java">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="java"/>
- <xsl:if test="following-sibling::*">
- <xsl:text> </xsl:text>
- </xsl:if>
- </span>
- </xsl:template>
- <xsl:template match="classname" mode="java">
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="java"/>
- </span>
- </xsl:template>
- <xsl:template match="interfacename" mode="java">
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="java"/>
- </span>
- </xsl:template>
- <xsl:template match="exceptionname" mode="java">
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="java"/>
- </span>
- </xsl:template>
- <xsl:template match="fieldsynopsis" mode="java">
- <code>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:if test="parent::classsynopsis">
- <xsl:text>  </xsl:text>
- </xsl:if>
- <xsl:apply-templates mode="java"/>
- <xsl:text>;</xsl:text>
- </code>
- <xsl:call-template name="synop-break"/>
- </xsl:template>
- <xsl:template match="type" mode="java">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="java"/>
- <xsl:text> </xsl:text>
- </span>
- </xsl:template>
- <xsl:template match="varname" mode="java">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="java"/>
- <xsl:text> </xsl:text>
- </span>
- </xsl:template>
- <xsl:template match="initializer" mode="java">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:text>= </xsl:text>
- <xsl:apply-templates mode="java"/>
- </span>
- </xsl:template>
- <xsl:template match="void" mode="java">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:text>void </xsl:text>
- </span>
- </xsl:template>
- <xsl:template match="methodname" mode="java">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="java"/>
- </span>
- </xsl:template>
- <xsl:template match="methodparam" mode="java">
- <xsl:param name="indent">0</xsl:param>
- <xsl:if test="preceding-sibling::methodparam">
- <xsl:text>,</xsl:text>
- <br/>
- <xsl:if test="$indent > 0">
- <xsl:call-template name="copy-string">
- <xsl:with-param name="string"> </xsl:with-param>
- <xsl:with-param name="count" select="$indent + 1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="java"/>
- </span>
- </xsl:template>
- <xsl:template match="parameter" mode="java">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="java"/>
- </span>
- </xsl:template>
- <xsl:template mode="java" match="constructorsynopsis|destructorsynopsis|methodsynopsis">
- <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
- <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
- <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
- <xsl:variable name="decl">
- <xsl:if test="parent::classsynopsis">
- <xsl:text>  </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="$start-modifiers" mode="java"/>
- <!-- type -->
- <xsl:if test="local-name($notmod[1]) != 'methodname'">
- <xsl:apply-templates select="$notmod[1]" mode="java"/>
- </xsl:if>
- <xsl:apply-templates select="methodname" mode="java"/>
- </xsl:variable>
- <code>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:copy-of select="$decl"/>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="methodparam" mode="java">
- <xsl:with-param name="indent" select="string-length($decl)"/>
- </xsl:apply-templates>
- <xsl:text>)</xsl:text>
- <xsl:if test="exceptionname">
- <br/>
- <xsl:text>    throws </xsl:text>
- <xsl:apply-templates select="exceptionname" mode="java"/>
- </xsl:if>
- <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="$end-modifiers" mode="java"/>
- </xsl:if>
- <xsl:text>;</xsl:text>
- </code>
- <xsl:call-template name="synop-break"/>
- </xsl:template>
- <!-- ===== C++ ========================================================= -->
- <xsl:template match="classsynopsis" mode="cpp">
- <pre>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates select="ooclass[1]" mode="cpp"/>
- <xsl:if test="ooclass[preceding-sibling::*]">
- <xsl:text>: </xsl:text>
- <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="cpp"/>
- <xsl:if test="oointerface|ooexception">
- <br/>
- <xsl:text>    </xsl:text>
- </xsl:if>
- </xsl:if>
- <xsl:if test="oointerface">
- <xsl:text> implements</xsl:text>
- <xsl:apply-templates select="oointerface" mode="cpp"/>
- <xsl:if test="ooexception">
- <br/>
- <xsl:text>    </xsl:text>
- </xsl:if>
- </xsl:if>
- <xsl:if test="ooexception">
- <xsl:text> throws</xsl:text>
- <xsl:apply-templates select="ooexception" mode="cpp"/>
- </xsl:if>
- <xsl:text> {</xsl:text>
- <br/>
- <xsl:apply-templates select="constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode="cpp"/>
- <xsl:text>}</xsl:text>
- </pre>
- </xsl:template>
- <xsl:template match="classsynopsisinfo" mode="cpp">
- <xsl:apply-templates mode="cpp"/>
- </xsl:template>
- <xsl:template match="ooclass|oointerface|ooexception" mode="cpp">
- <xsl:if test="preceding-sibling::*">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="cpp"/>
- </span>
- </xsl:template>
- <xsl:template match="modifier|package" mode="cpp">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="cpp"/>
- <xsl:if test="following-sibling::*">
- <xsl:text> </xsl:text>
- </xsl:if>
- </span>
- </xsl:template>
- <xsl:template match="classname" mode="cpp">
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="cpp"/>
- </span>
- </xsl:template>
- <xsl:template match="interfacename" mode="cpp">
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="cpp"/>
- </span>
- </xsl:template>
- <xsl:template match="exceptionname" mode="cpp">
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="cpp"/>
- </span>
- </xsl:template>
- <xsl:template match="fieldsynopsis" mode="cpp">
- <code>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:if test="parent::classsynopsis">
- <xsl:text>  </xsl:text>
- </xsl:if>
- <xsl:apply-templates mode="cpp"/>
- <xsl:text>;</xsl:text>
- </code>
- <xsl:call-template name="synop-break"/>
- </xsl:template>
- <xsl:template match="type" mode="cpp">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="cpp"/>
- <xsl:text> </xsl:text>
- </span>
- </xsl:template>
- <xsl:template match="varname" mode="cpp">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="cpp"/>
- <xsl:text> </xsl:text>
- </span>
- </xsl:template>
- <xsl:template match="initializer" mode="cpp">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:text>= </xsl:text>
- <xsl:apply-templates mode="cpp"/>
- </span>
- </xsl:template>
- <xsl:template match="void" mode="cpp">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:text>void </xsl:text>
- </span>
- </xsl:template>
- <xsl:template match="methodname" mode="cpp">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="cpp"/>
- </span>
- </xsl:template>
- <xsl:template match="methodparam" mode="cpp">
- <xsl:if test="preceding-sibling::methodparam">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="cpp"/>
- </span>
- </xsl:template>
- <xsl:template match="parameter" mode="cpp">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="cpp"/>
- </span>
- </xsl:template>
- <xsl:template mode="cpp" match="constructorsynopsis|destructorsynopsis|methodsynopsis">
- <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
- <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
- <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
- <code>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:if test="parent::classsynopsis">
- <xsl:text>  </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="$start-modifiers" mode="cpp"/>
- <!-- type -->
- <xsl:if test="local-name($notmod[1]) != 'methodname'">
- <xsl:apply-templates select="$notmod[1]" mode="cpp"/>
- </xsl:if>
- <xsl:apply-templates select="methodname" mode="cpp"/>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="methodparam" mode="cpp"/>
- <xsl:text>)</xsl:text>
- <xsl:if test="exceptionname">
- <br/>
- <xsl:text>    throws </xsl:text>
- <xsl:apply-templates select="exceptionname" mode="cpp"/>
- </xsl:if>
- <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="$end-modifiers" mode="cpp"/>
- </xsl:if>
- <xsl:text>;</xsl:text>
- </code>
- <xsl:call-template name="synop-break"/>
- </xsl:template>
- <!-- ===== IDL ========================================================= -->
- <xsl:template match="classsynopsis" mode="idl">
- <pre>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:text>interface </xsl:text>
- <xsl:apply-templates select="ooclass[1]" mode="idl"/>
- <xsl:if test="ooclass[preceding-sibling::*]">
- <xsl:text>: </xsl:text>
- <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="idl"/>
- <xsl:if test="oointerface|ooexception">
- <br/>
- <xsl:text>    </xsl:text>
- </xsl:if>
- </xsl:if>
- <xsl:if test="oointerface">
- <xsl:text> implements</xsl:text>
- <xsl:apply-templates select="oointerface" mode="idl"/>
- <xsl:if test="ooexception">
- <br/>
- <xsl:text>    </xsl:text>
- </xsl:if>
- </xsl:if>
- <xsl:if test="ooexception">
- <xsl:text> throws</xsl:text>
- <xsl:apply-templates select="ooexception" mode="idl"/>
- </xsl:if>
- <xsl:text> {</xsl:text>
- <br/>
- <xsl:apply-templates select="constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode="idl"/>
- <xsl:text>}</xsl:text>
- </pre>
- </xsl:template>
- <xsl:template match="classsynopsisinfo" mode="idl">
- <xsl:apply-templates mode="idl"/>
- </xsl:template>
- <xsl:template match="ooclass|oointerface|ooexception" mode="idl">
- <xsl:if test="preceding-sibling::*">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="idl"/>
- </span>
- </xsl:template>
- <xsl:template match="modifier|package" mode="idl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="idl"/>
- <xsl:if test="following-sibling::*">
- <xsl:text> </xsl:text>
- </xsl:if>
- </span>
- </xsl:template>
- <xsl:template match="classname" mode="idl">
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="idl"/>
- </span>
- </xsl:template>
- <xsl:template match="interfacename" mode="idl">
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="idl"/>
- </span>
- </xsl:template>
- <xsl:template match="exceptionname" mode="idl">
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="idl"/>
- </span>
- </xsl:template>
- <xsl:template match="fieldsynopsis" mode="idl">
- <code>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:if test="parent::classsynopsis">
- <xsl:text>  </xsl:text>
- </xsl:if>
- <xsl:apply-templates mode="idl"/>
- <xsl:text>;</xsl:text>
- </code>
- <xsl:call-template name="synop-break"/>
- </xsl:template>
- <xsl:template match="type" mode="idl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="idl"/>
- <xsl:text> </xsl:text>
- </span>
- </xsl:template>
- <xsl:template match="varname" mode="idl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="idl"/>
- <xsl:text> </xsl:text>
- </span>
- </xsl:template>
- <xsl:template match="initializer" mode="idl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:text>= </xsl:text>
- <xsl:apply-templates mode="idl"/>
- </span>
- </xsl:template>
- <xsl:template match="void" mode="idl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:text>void </xsl:text>
- </span>
- </xsl:template>
- <xsl:template match="methodname" mode="idl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="idl"/>
- </span>
- </xsl:template>
- <xsl:template match="methodparam" mode="idl">
- <xsl:if test="preceding-sibling::methodparam">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="idl"/>
- </span>
- </xsl:template>
- <xsl:template match="parameter" mode="idl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="idl"/>
- </span>
- </xsl:template>
- <xsl:template mode="idl" match="constructorsynopsis|destructorsynopsis|methodsynopsis">
- <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
- <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
- <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
- <code>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:if test="parent::classsynopsis">
- <xsl:text>  </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="$start-modifiers" mode="idl"/>
- <!-- type -->
- <xsl:if test="local-name($notmod[1]) != 'methodname'">
- <xsl:apply-templates select="$notmod[1]" mode="idl"/>
- </xsl:if>
- <xsl:apply-templates select="methodname" mode="idl"/>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="methodparam" mode="idl"/>
- <xsl:text>)</xsl:text>
- <xsl:if test="exceptionname">
- <br/>
- <xsl:text>    raises(</xsl:text>
- <xsl:apply-templates select="exceptionname" mode="idl"/>
- <xsl:text>)</xsl:text>
- </xsl:if>
- <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="$end-modifiers" mode="idl"/>
- </xsl:if>
- <xsl:text>;</xsl:text>
- </code>
- <xsl:call-template name="synop-break"/>
- </xsl:template>
- <!-- ===== Perl ======================================================== -->
- <xsl:template match="classsynopsis" mode="perl">
- <pre>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:text>package </xsl:text>
- <xsl:apply-templates select="ooclass[1]" mode="perl"/>
- <xsl:text>;</xsl:text>
- <br/>
- <xsl:if test="ooclass[preceding-sibling::*]">
- <xsl:text>@ISA = (</xsl:text>
- <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="perl"/>
- <xsl:text>);</xsl:text>
- <br/>
- </xsl:if>
- <xsl:apply-templates select="constructorsynopsis |destructorsynopsis |fieldsynopsis |methodsynopsis |classsynopsisinfo" mode="perl"/>
- </pre>
- </xsl:template>
- <xsl:template match="classsynopsisinfo" mode="perl">
- <xsl:apply-templates mode="perl"/>
- </xsl:template>
- <xsl:template match="ooclass|oointerface|ooexception" mode="perl">
- <xsl:if test="preceding-sibling::*">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="perl"/>
- </span>
- </xsl:template>
- <xsl:template match="modifier|package" mode="perl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="perl"/>
- <xsl:if test="following-sibling::*">
- <xsl:text> </xsl:text>
- </xsl:if>
- </span>
- </xsl:template>
- <xsl:template match="classname" mode="perl">
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="perl"/>
- </span>
- </xsl:template>
- <xsl:template match="interfacename" mode="perl">
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="perl"/>
- </span>
- </xsl:template>
- <xsl:template match="exceptionname" mode="perl">
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="perl"/>
- </span>
- </xsl:template>
- <xsl:template match="fieldsynopsis" mode="perl">
- <code>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:if test="parent::classsynopsis">
- <xsl:text>  </xsl:text>
- </xsl:if>
- <xsl:apply-templates mode="perl"/>
- <xsl:text>;</xsl:text>
- </code>
- <xsl:call-template name="synop-break"/>
- </xsl:template>
- <xsl:template match="type" mode="perl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="perl"/>
- <xsl:text> </xsl:text>
- </span>
- </xsl:template>
- <xsl:template match="varname" mode="perl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="perl"/>
- <xsl:text> </xsl:text>
- </span>
- </xsl:template>
- <xsl:template match="initializer" mode="perl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:text>= </xsl:text>
- <xsl:apply-templates mode="perl"/>
- </span>
- </xsl:template>
- <xsl:template match="void" mode="perl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:text>void </xsl:text>
- </span>
- </xsl:template>
- <xsl:template match="methodname" mode="perl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="perl"/>
- </span>
- </xsl:template>
- <xsl:template match="methodparam" mode="perl">
- <xsl:if test="preceding-sibling::methodparam">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="perl"/>
- </span>
- </xsl:template>
- <xsl:template match="parameter" mode="perl">
- <span>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:apply-templates mode="perl"/>
- </span>
- </xsl:template>
- <xsl:template mode="perl" match="constructorsynopsis|destructorsynopsis|methodsynopsis">
- <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
- <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
- <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
- <code>
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:text>sub </xsl:text>
- <xsl:apply-templates select="methodname" mode="perl"/>
- <xsl:text> { ... };</xsl:text>
- </code>
- <xsl:call-template name="synop-break"/>
- </xsl:template>
- <!-- ==================================================================== -->
- <!-- * DocBook 5 allows linking elements (link, olink, and xref) -->
- <!-- * within the OO *synopsis elements (classsynopsis, fieldsynopsis, -->
- <!-- * methodsynopsis, constructorsynopsis, destructorsynopsis) and -->
- <!-- * their children. So we need to have mode="java|cpp|idl|perl" -->
- <!-- * per-mode matches for those linking elements in order for them -->
- <!-- * to be processed as expected. -->
- <xsl:template match="link|olink|xref" mode="java">
- <xsl:apply-templates select="."/>
- </xsl:template>
- <xsl:template match="link|olink|xref" mode="cpp">
- <xsl:apply-templates select="."/>
- </xsl:template>
- <xsl:template match="link|olink|xref" mode="idl">
- <xsl:apply-templates select="."/>
- </xsl:template>
- <xsl:template match="link|olink|xref" mode="perl">
- <xsl:apply-templates select="."/>
- </xsl:template>
- </xsl:stylesheet>
|