]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/mmlextension.xsl
----------------------------------------------------------------------
[helm.git] / helm / style / mmlextension.xsl
index 6572c0556c3f93890248c12c0fe70365fbbefaaf..21225aa8638e98d0211d15eccc6a4d0ee7498f47 100644 (file)
@@ -737,8 +737,8 @@ which generates the toplevel element (see for instance xlink) -->
            </m:mrow>
           </m:mtd>
          </m:mtr>
-         <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
-         <xsl:variable name="charlength"><xsl:apply-templates select="." mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
+         <xsl:for-each select="piecewise/piece">
+         <xsl:variable name="charlength"><xsl:apply-templates select="./*[2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
          <m:mtr>
           <m:mtd>
            <m:mrow>
@@ -751,10 +751,10 @@ which generates the toplevel element (see for instance xlink) -->
             </xsl:otherwise>
             </xsl:choose>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
-            <xsl:apply-templates select="."/>
+            <xsl:apply-templates select="./*[2]"/>
             <xsl:if test="$framewidth > $charlength">
              <m:mo mathcolor="Green">&#x21d2;</m:mo>
-             <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+             <xsl:apply-templates select="./*[1]"/>
             </xsl:if>
            </m:mrow>
           </m:mtd>
@@ -765,7 +765,7 @@ which generates the toplevel element (see for instance xlink) -->
            <m:mrow>
             <m:mphantom><m:mtext>|_</m:mtext></m:mphantom>  
             <m:mo mathcolor="Green">&#x21d2;</m:mo>
-            <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+            <xsl:apply-templates select="./*[1]"/>
            </m:mrow>
           </m:mtd>
          </m:mtr>
@@ -787,15 +787,15 @@ which generates the toplevel element (see for instance xlink) -->
         <xsl:apply-templates select="*[position()=3]"/>
         <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
         <m:mo>OF</m:mo>
-        <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+        <xsl:for-each select="piecewise/piece">
          <xsl:choose>
          <xsl:when test="position() != 1">
           <m:mo stretchy="false">|</m:mo>
          </xsl:when> 
          </xsl:choose>
-         <xsl:apply-templates select="."/>
+         <xsl:apply-templates select="./*[2]"/>
          <m:mo mathcolor="Green">&#x21d2;</m:mo>
-         <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+         <xsl:apply-templates select="./*[1]"/>
         </xsl:for-each>
         <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
         <m:mo>END</m:mo>