]> matita.cs.unibo.it Git - helm.git/commitdiff
Improved rendering for rewriting steps: a little indentation added
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 4 Apr 2001 15:00:00 +0000 (15:00 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 4 Apr 2001 15:00:00 +0000 (15:00 +0000)
and a bug in "charcount" called fix.

REMEMBER: charcount mode must be used only on the first child
 because it counts the size of the node considered, its descendants,
 its siblings and all their descendants

helm/style/content_to_html.xsl

index ba3ec1d002d111a5aa5ddbf51c5347162e391647..75b7bcc3adf7f3b7ed6b0cb307806b214be52023 100644 (file)
         </xsl:otherwise>
        </xsl:choose>
        <xsl:variable name="charlength_first">
-        <xsl:apply-templates select="*[3]" mode="charcount"/>
+        <xsl:apply-templates select="*[3]/*[1]" mode="charcount"/>
        </xsl:variable>
        <xsl:variable name="charlength_second">
-        <xsl:apply-templates select="*[4]" mode="charcount"/>
+        <xsl:apply-templates select="*[4]/*[1]" mode="charcount"/>
        </xsl:variable>
        <xsl:variable name="charlength_side_proof">
-        <xsl:apply-templates select="*[5]" mode="charcount"/>
+        <xsl:apply-templates select="*[5]/*[1]" mode="charcount"/>
        </xsl:variable>
        <xsl:variable name="split1"
           select="$charlength_first + $charlength_second > $framewidth"/>
        <xsl:if test="$split1">
        <br/>
        <xsl:call-template name="make_indent">
-        <xsl:with-param name="current_indent" select="$current_indent"/> 
+        <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
        </xsl:call-template>
        </xsl:if>
        <FONT color="red">with&#x00a0;</FONT>
        <xsl:if test="$split2">
        <br/>
        <xsl:call-template name="make_indent">
-        <xsl:with-param name="current_indent" select="$current_indent"/> 
+        <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
        </xsl:call-template>
        </xsl:if>
        <FONT color="red">by&#x00a0;</FONT>
        <xsl:apply-templates select="*[5]">
-        <xsl:with-param name="current_indent" select="$current_indent+5"/>
+        <xsl:with-param name="current_indent" select="$current_indent+7"/>
        </xsl:apply-templates>
       </xsl:when>
       <!-- rewrite and apply -->