From: <pau...@us...> - 2011-02-27 16:03:14
|
Author: paultremblay Date: 2011-02-27 17:03:06 +0100 (Sun, 27 Feb 2011) New Revision: 6965 Modified: trunk/sandbox/paultremblay/tools/make_extend_table.py Log: Fixed duplicate template generation. Modified: trunk/sandbox/paultremblay/tools/make_extend_table.py =================================================================== --- trunk/sandbox/paultremblay/tools/make_extend_table.py 2011-02-26 18:00:30 UTC (rev 6964) +++ trunk/sandbox/paultremblay/tools/make_extend_table.py 2011-02-27 16:03:06 UTC (rev 6965) @@ -179,8 +179,15 @@ </xsl:variable> <fo:table-column column-number="{$col-num}" column-width="proportional-column-width({@colwidth})"/> - </xsl:template>\n""" + </xsl:template> + <xsl:template match="tgroup" mode="classes"> + <xsl:param name="classes"/> + <xsl:apply-templates mode="classes"> + <xsl:with-param name="classes" select="$classes"/> + </xsl:apply-templates> + </xsl:template>\n""" + write_obj.write(s) for n in range(1,en): @@ -204,14 +211,7 @@ </fo:block-container> </xsl:template> - <xsl:template match="tgroup" mode="classes"> - <xsl:param name="classes"/> - <xsl:apply-templates mode="classes"> - <xsl:with-param name="classes" select="$classes"/> - </xsl:apply-templates> - </xsl:template> - <xsl:template match="table[@classes = 'table%s']/tgroup/thead" mode="classes"> <fo:table-header xsl:use-attribute-sets = "thead%s-header"> <xsl:apply-templates mode="classes"/> @@ -261,7 +261,7 @@ <xsl:choose> <xsl:when test="$cols-spanned= 1 and $rows-spanned = 1"> <fo:table-cell xsl:use-attribute-sets="table%s-cell"> - <xsl:apply-templates mode="classes"/> + <xsl:apply-templates/> <xsl:if test="not(paragraph)"> <fo:block/> </xsl:if> @@ -270,7 +270,7 @@ <xsl:when test="$cols-spanned= 1"> <fo:table-cell xsl:use-attribute-sets="table%s-cell" number-rows-spanned="{$rows-spanned}"> - <xsl:apply-templates mode="classes"/> + <xsl:apply-templates /> <xsl:if test="not(paragraph)"> <fo:block/> </xsl:if> @@ -279,7 +279,7 @@ <xsl:when test="$rows-spanned= 1"> <fo:table-cell xsl:use-attribute-sets="table%s-cell" number-columns-spanned="{$cols-spanned}"> - <xsl:apply-templates mode="classes"/> + <xsl:apply-templates /> <xsl:if test="not(paragraph)"> <fo:block/> </xsl:if> @@ -289,7 +289,7 @@ <fo:table-cell xsl:use-attribute-sets="table%s-cell" number-rows-spanned="{$rows-spanned}" number-columns-spanned="{$cols-spanned}"> - <xsl:apply-templates mode="classes"/> + <xsl:apply-templates /> <xsl:if test="not(paragraph)"> <fo:block/> </xsl:if> @@ -298,7 +298,7 @@ </xsl:choose> </xsl:template> - <xsl:template match="table[@classes='table%s']/tgroup/tbody/row/entry/paragraph" mode="classes"> + <xsl:template match="table[@classes='table%s']/tgroup/tbody/row/entry/paragraph" > <fo:block xsl:use-attribute-sets="cell%s-block"> <xsl:apply-templates/> </fo:block> |