]> matita.cs.unibo.it Git - helm.git/commitdiff
Bug fixed: empty elements did not ask for the size of their first following siblings...
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Mon, 24 Jun 2002 15:17:48 +0000 (15:17 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Mon, 24 Jun 2002 15:17:48 +0000 (15:17 +0000)
charcount mode.

helm/style/mmlextension.xsl

index e7af0c854381aaefda7492c2695d203e3e8288a9..4a801a65402c244e03bbe273c6a4d7a7ba1709a3 100644 (file)
@@ -2138,7 +2138,16 @@ which generates the toplevel element (see for instance xlink) -->
 <xsl:param name="nosibling" select="0"/>
  <xsl:choose>
   <xsl:when test="count(child::*) = 0">
-   <xsl:value-of select="$incurrent_length"/>
+   <!-- tremendous bug fixed. An empty element can still have siblings!!! -->
+   <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length"/></xsl:apply-templates></xsl:variable>
+   <xsl:choose>
+    <xsl:when test="string($siblength) = &quot;&quot;">
+     <xsl:value-of select="$incurrent_length"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+    </xsl:otherwise>
+   </xsl:choose>
   </xsl:when>
   <xsl:otherwise>
     <xsl:variable name="childlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length"/><xsl:with-param name="nosibling" select="0"/></xsl:apply-templates></xsl:variable>