]> matita.cs.unibo.it Git - helm.git/commitdiff
The same patch I have applied in the previous commit to m:ci has been
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 8 Nov 2001 18:47:12 +0000 (18:47 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 8 Nov 2001 18:47:12 +0000 (18:47 +0000)
applied to m:mn.

helm/style/mmlctop.xsl-0.14

index ade27944aa038424e6755b845ff74dd010aa0bfb..693f962a387a15db6903ef6cf9bbeb12d57801ff 100755 (executable)
@@ -299,8 +299,10 @@ LINEAR ALGEBRA
   <xsl:param name="PAREN" select="$PAR_NO"/>
   <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
 <!-- HELM: added -->
+<!-- CSC
 <xsl:choose>
   <xsl:when test="child::text()">
+-->
 <!-- HELM -->
   <xsl:choose>
     <xsl:when test=". &lt; 0 and $IN_PREC &gt; $NO_PREC and $PAREN=$PAR_NO
@@ -326,6 +328,7 @@ LINEAR ALGEBRA
     </xsl:otherwise>
   </xsl:choose>
 <!-- HELM: added -->
+<!--CSC
   </xsl:when>
   <xsl:otherwise>
    <m:mrow>
@@ -336,6 +339,7 @@ LINEAR ALGEBRA
    </m:mrow> 
   </xsl:otherwise>
  </xsl:choose>
+-->
 <!-- HELM -->
 </xsl:template>
 
@@ -420,9 +424,29 @@ LINEAR ALGEBRA
         <m:mn> <xsl:value-of select="@base"/> </m:mn>
       </m:msub>
    </xsl:when>
-    <xsl:otherwise>
+   <xsl:otherwise>
+<!--HELM: Was:
+ <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
+HELM: Now is: -->
+    <xsl:choose>
+     <xsl:when test="child::text() and not(*[1])">
       <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
-    </xsl:otherwise>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:choose>
+       <xsl:when test="not(*[2])">
+        <xsl:copy-of select="*[1]"/>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mrow>
+         <xsl:copy-of select="*|text()"/>
+        </m:mrow>
+       </xsl:otherwise>
+      </xsl:choose>
+     </xsl:otherwise>
+    </xsl:choose>
+<!-- HELM -->
+   </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
 
@@ -507,9 +531,33 @@ LINEAR ALGEBRA
         <m:mn> <xsl:value-of select="@base"/> </m:mn>
       </m:msub>
    </xsl:when>
-    <xsl:otherwise>
-      <m:mn m:xref="{@id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
-    </xsl:otherwise>
+   <xsl:otherwise>
+    <xsl:choose>
+     <xsl:when test="child::text() and not(*[1])">
+      <m:mn m:xref="{$id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:variable name="id" select="@id"/>
+      <xsl:choose>
+       <xsl:when test="not(*[2])">
+        <xsl:for-each select="*[1]">
+         <xsl:copy>
+          <xsl:attribute name="m:xref">
+           <xsl:value-of select="$id"/>
+          </xsl:attribute>
+          <xsl:copy-of select="@*|*"/>
+         </xsl:copy>
+        </xsl:for-each>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mrow m:xref="{$id}">
+         <xsl:copy-of select="*|text()"/>
+        </m:mrow>
+       </xsl:otherwise>
+      </xsl:choose>
+     </xsl:otherwise>
+    </xsl:choose>
+   </xsl:otherwise>
   </xsl:choose>
 </xsl:template>