From: Michael S. <xm...@us...> - 2005-11-14 06:15:37
|
Update of /cvsroot/docbook/xsl/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2308/html Modified Files: synop.xsl Log Message: Added handling for cases of Methodsynopsis that have Modifier instances after the Methodname. Closes #1353365; thanks to Stephen Langer for reporting. Index: synop.xsl =================================================================== RCS file: /cvsroot/docbook/xsl/html/synop.xsl,v retrieving revision 1.19 retrieving revision 1.20 diff -u -U2 -r1.19 -r1.20 --- synop.xsl 9 Nov 2005 14:41:41 -0000 1.19 +++ synop.xsl 14 Nov 2005 06:15:29 -0000 1.20 @@ -777,5 +777,7 @@ <span class="{name(.)}"> <xsl:apply-templates mode="java"/> - <xsl:text> </xsl:text> + <xsl:if test="following-sibling::*"> + <xsl:text> </xsl:text> + </xsl:if> </span> </xsl:template> @@ -877,11 +879,12 @@ <xsl:template mode="java" match="constructorsynopsis|destructorsynopsis|methodsynopsis"> - <xsl:variable name="modifiers" select="modifier"/> + <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[name(.) != 'modifier']]"/> <xsl:variable name="notmod" select="*[name(.) != 'modifier']"/> + <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[name(.) != 'modifier']]"/> <xsl:variable name="decl"> <xsl:if test="parent::classsynopsis"> <xsl:text> </xsl:text> </xsl:if> - <xsl:apply-templates select="$modifiers" mode="java"/> + <xsl:apply-templates select="$start-modifiers" mode="java"/> <!-- type --> @@ -905,4 +908,8 @@ <xsl:apply-templates select="exceptionname" mode="java"/> </xsl:if> + <xsl:if test="modifier[preceding-sibling::*[name(.) != 'modifier']]"> + <xsl:text> </xsl:text> + <xsl:apply-templates select="$end-modifiers" mode="java"/> + </xsl:if> <xsl:text>;</xsl:text> </code> @@ -962,5 +969,7 @@ <span class="{name(.)}"> <xsl:apply-templates mode="cpp"/> - <xsl:text> </xsl:text> + <xsl:if test="following-sibling::*"> + <xsl:text> </xsl:text> + </xsl:if> </span> </xsl:template> @@ -1054,6 +1063,7 @@ <xsl:template mode="cpp" match="constructorsynopsis|destructorsynopsis|methodsynopsis"> - <xsl:variable name="modifiers" select="modifier"/> + <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[name(.) != 'modifier']]"/> <xsl:variable name="notmod" select="*[name(.) != 'modifier']"/> + <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[name(.) != 'modifier']]"/> <code class="{name(.)}"> @@ -1061,5 +1071,5 @@ <xsl:text> </xsl:text> </xsl:if> - <xsl:apply-templates select="$modifiers" mode="cpp"/> + <xsl:apply-templates select="$start-modifiers" mode="cpp"/> <!-- type --> @@ -1077,4 +1087,8 @@ <xsl:apply-templates select="exceptionname" mode="cpp"/> </xsl:if> + <xsl:if test="modifier[preceding-sibling::*[name(.) != 'modifier']]"> + <xsl:text> </xsl:text> + <xsl:apply-templates select="$end-modifiers" mode="cpp"/> + </xsl:if> <xsl:text>;</xsl:text> </code> @@ -1135,5 +1149,7 @@ <span class="{name(.)}"> <xsl:apply-templates mode="idl"/> - <xsl:text> </xsl:text> + <xsl:if test="following-sibling::*"> + <xsl:text> </xsl:text> + </xsl:if> </span> </xsl:template> @@ -1227,12 +1243,12 @@ <xsl:template mode="idl" match="constructorsynopsis|destructorsynopsis|methodsynopsis"> - <xsl:variable name="modifiers" select="modifier"/> + <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[name(.) != 'modifier']]"/> <xsl:variable name="notmod" select="*[name(.) != 'modifier']"/> - + <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[name(.) != 'modifier']]"/> <code class="{name(.)}"> <xsl:if test="parent::classsynopsis"> <xsl:text> </xsl:text> </xsl:if> - <xsl:apply-templates select="$modifiers" mode="idl"/> + <xsl:apply-templates select="$start-modifiers" mode="idl"/> <!-- type --> @@ -1251,4 +1267,8 @@ <xsl:text>)</xsl:text> </xsl:if> + <xsl:if test="modifier[preceding-sibling::*[name(.) != 'modifier']]"> + <xsl:text> </xsl:text> + <xsl:apply-templates select="$end-modifiers" mode="idl"/> + </xsl:if> <xsl:text>;</xsl:text> </code> @@ -1296,5 +1316,7 @@ <span class="{name(.)}"> <xsl:apply-templates mode="perl"/> - <xsl:text> </xsl:text> + <xsl:if test="following-sibling::*"> + <xsl:text> </xsl:text> + </xsl:if> </span> </xsl:template> @@ -1388,6 +1410,7 @@ <xsl:template mode="perl" match="constructorsynopsis|destructorsynopsis|methodsynopsis"> - <xsl:variable name="modifiers" select="modifier"/> + <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[name(.) != 'modifier']]"/> <xsl:variable name="notmod" select="*[name(.) != 'modifier']"/> + <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[name(.) != 'modifier']]"/> <code class="{name(.)}"> |