applied a fix for methodsynopsis from docbook svn revision 6147

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18835 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2006-09-14 12:26:32 +00:00
parent 277a78abf5
commit c5ede1427a
+58 -15
View File
@@ -6,7 +6,7 @@
version='1.0'> version='1.0'>
<!-- ******************************************************************** <!-- ********************************************************************
$Id: synop.xsl,v 1.22 2006/04/19 12:47:23 nwalsh Exp $ $Id$
******************************************************************** ********************************************************************
This file is part of the XSL DocBook Stylesheet distribution. This file is part of the XSL DocBook Stylesheet distribution.
@@ -190,9 +190,13 @@ paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<!--
<xsl:variable name="tabular-p" <xsl:variable name="tabular-p"
select="$funcsynopsis.tabular.threshold &gt; 0 select="$funcsynopsis.tabular.threshold &gt; 0
and string-length(.) &gt; $funcsynopsis.tabular.threshold"/> and string-length(.) &gt; $funcsynopsis.tabular.threshold"/>
-->
<xsl:variable name="tabular-p" select="true()"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$style = 'kr' and $tabular-p"> <xsl:when test="$style = 'kr' and $tabular-p">
@@ -321,7 +325,7 @@ paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
</td> </td>
<xsl:apply-templates select="(void|varargs|paramdef)[1]" mode="kr-tabular"/> <xsl:apply-templates select="(void|varargs|paramdef)[1]" mode="kr-tabular"/>
</tr> </tr>
<xsl:for-each select="(void|varargs|paramdef)[preceding-sibling::*]"> <xsl:for-each select="(void|varargs|paramdef)[preceding-sibling::*[not(self::funcdef)]]">
<tr> <tr>
<td>&#160;</td> <td>&#160;</td>
<xsl:apply-templates select="." mode="kr-tabular"/> <xsl:apply-templates select="." mode="kr-tabular"/>
@@ -406,20 +410,39 @@ paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
</xsl:template> </xsl:template>
<xsl:template match="paramdef" mode="kr-tabular-funcsynopsis-mode"> <xsl:template match="paramdef" mode="kr-tabular-funcsynopsis-mode">
<tr> <xsl:variable name="type">
<xsl:choose> <xsl:choose>
<xsl:when test="type and funcparams"> <xsl:when test="type">
<td>
<code>
<xsl:apply-templates select="type" <xsl:apply-templates select="type"
mode="kr-tabular-funcsynopsis-mode"/> 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> </code>
<xsl:text>&#160;</xsl:text> <xsl:text>&#160;</xsl:text>
</td> </td>
<td> <td>
<code> <code>
<xsl:choose>
<xsl:when test="type">
<xsl:apply-templates select="type/following-sibling::*" <xsl:apply-templates select="type/following-sibling::*"
mode="kr-tabular-funcsynopsis-mode"/> mode="kr-tabular-funcsynopsis-mode"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*"
mode="kr-tabular-funcsynopsis-mode"/>
</xsl:otherwise>
</xsl:choose>
</code> </code>
</td> </td>
</xsl:when> </xsl:when>
@@ -435,7 +458,7 @@ paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
<xsl:otherwise> <xsl:otherwise>
<td> <td>
<code> <code>
<xsl:apply-templates select="parameter/preceding-sibling::*[not(self::parameter)]" <xsl:apply-templates select="parameter/preceding-sibling::node()[not(self::parameter)]"
mode="kr-tabular-funcsynopsis-mode"/> mode="kr-tabular-funcsynopsis-mode"/>
</code> </code>
<xsl:text>&#160;</xsl:text> <xsl:text>&#160;</xsl:text>
@@ -562,7 +585,7 @@ paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
</td> </td>
<xsl:apply-templates select="(void|varargs|paramdef)[1]" mode="ansi-tabular"/> <xsl:apply-templates select="(void|varargs|paramdef)[1]" mode="ansi-tabular"/>
</tr> </tr>
<xsl:for-each select="(void|varargs|paramdef)[preceding-sibling::*]"> <xsl:for-each select="(void|varargs|paramdef)[preceding-sibling::*[not(self::funcdef)]]">
<tr> <tr>
<td>&#160;</td> <td>&#160;</td>
<xsl:apply-templates select="." mode="ansi-tabular"/> <xsl:apply-templates select="." mode="ansi-tabular"/>
@@ -607,15 +630,35 @@ paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
</xsl:template> </xsl:template>
<xsl:template match="paramdef" mode="ansi-tabular"> <xsl:template match="paramdef" mode="ansi-tabular">
<xsl:variable name="type">
<xsl:choose> <xsl:choose>
<xsl:when test="type and funcparams"> <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> <td>
<xsl:apply-templates select="type" mode="ansi-tabular"/> <xsl:copy-of select="$type"/>
<xsl:text>&#160;</xsl:text> <xsl:text>&#160;</xsl:text>
</td> </td>
<td> <td>
<xsl:choose>
<xsl:when test="type">
<xsl:apply-templates select="type/following-sibling::*" <xsl:apply-templates select="type/following-sibling::*"
mode="ansi-tabular"/> mode="ansi-tabular"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*"
mode="ansi-tabular"/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose> <xsl:choose>
<xsl:when test="following-sibling::*"> <xsl:when test="following-sibling::*">
<xsl:text>, </xsl:text> <xsl:text>, </xsl:text>
@@ -629,7 +672,7 @@ paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<td> <td>
<xsl:apply-templates select="parameter/preceding-sibling::*[not(self::parameter)]" <xsl:apply-templates select="parameter/preceding-sibling::node()[not(self::parameter)]"
mode="ansi-tabular"/> mode="ansi-tabular"/>
<xsl:text>&#160;</xsl:text> <xsl:text>&#160;</xsl:text>
</td> </td>
@@ -868,7 +911,7 @@ paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
<xsl:template match="methodparam" mode="java"> <xsl:template match="methodparam" mode="java">
<xsl:param name="indent">0</xsl:param> <xsl:param name="indent">0</xsl:param>
<xsl:if test="preceding-sibling::*"> <xsl:if test="preceding-sibling::methodparam">
<xsl:text>,</xsl:text> <xsl:text>,</xsl:text>
<br/> <br/>
<xsl:if test="$indent &gt; 0"> <xsl:if test="$indent &gt; 0">
@@ -1059,7 +1102,7 @@ paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
</xsl:template> </xsl:template>
<xsl:template match="methodparam" mode="cpp"> <xsl:template match="methodparam" mode="cpp">
<xsl:if test="preceding-sibling::*"> <xsl:if test="preceding-sibling::methodparam">
<xsl:text>, </xsl:text> <xsl:text>, </xsl:text>
</xsl:if> </xsl:if>
<span class="{name(.)}"> <span class="{name(.)}">
@@ -1239,7 +1282,7 @@ paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
</xsl:template> </xsl:template>
<xsl:template match="methodparam" mode="idl"> <xsl:template match="methodparam" mode="idl">
<xsl:if test="preceding-sibling::*"> <xsl:if test="preceding-sibling::methodparam">
<xsl:text>, </xsl:text> <xsl:text>, </xsl:text>
</xsl:if> </xsl:if>
<span class="{name(.)}"> <span class="{name(.)}">
@@ -1406,7 +1449,7 @@ paramdef ::= (#PCDATA|type|replaceable|parameter|funcparams)*
</xsl:template> </xsl:template>
<xsl:template match="methodparam" mode="perl"> <xsl:template match="methodparam" mode="perl">
<xsl:if test="preceding-sibling::*"> <xsl:if test="preceding-sibling::methodparam">
<xsl:text>, </xsl:text> <xsl:text>, </xsl:text>
</xsl:if> </xsl:if>
<span class="{name(.)}"> <span class="{name(.)}">