]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/mml2mmlv1_0.xsl
Modified Files:
[helm.git] / helm / style / mml2mmlv1_0.xsl
index fd36e25132701af08b6eb6ce7eb788a49287f5e1..c88dd3da2a925c2a5fa8dcfc6582ae2dde583f9c 100644 (file)
 
 <!-- BASIC ELEMENTS -->
 
+<!-- HELM: cn could not contain MAthMl presentation -->
 <xsl:template match = "m:cn">
   <xsl:param name="IN_PREC" select="$NO_PREC"/>
   <xsl:param name="PAREN" select="$PAR_NO"/>
   <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+<!-- HELM: added -->
+<xsl:choose>
+  <xsl:when test="child::text()">
+<!-- HELM -->
   <xsl:choose>
     <xsl:when test=". &lt; 0 and $IN_PREC &gt; 0 and $PAREN=$PAR_NO and $PAR_NO_IGNORE=$NO">
       <m:mfenced separators="">
       <xsl:apply-templates select="." mode="cn"/>
     </xsl:otherwise>
   </xsl:choose>
+<!-- HELM: added -->
+</xsl:when>
+  <xsl:otherwise>
+   <xsl:copy-of select="*"/> 
+  </xsl:otherwise>
+ </xsl:choose>
+<!-- HELM -->
 </xsl:template>
 
 <xsl:template match = "m:cn" mode="cn">
       <m:mi fontweight="bold"> <xsl:apply-templates mode = "semantics"/> </m:mi>
     </xsl:when>
     <xsl:otherwise>
-<!-- <CSC> Originale:
+<!-- HELM: ci could not contain MathML presentation 
      <m:mi> 
       <xsl:call-template name="insert"/>
       <xsl:apply-templates mode = "semantics"/> 
      </m:mi>
-</CSC> -->
-<!-- <CSC> Modificato: -->
+-->
  <xsl:choose>
+  <!-- HELM: or the opposite test <xsl:when test="*[1]"> -->
   <xsl:when test="child::text()">
    <m:mi> 
     <xsl:call-template name="insert"/>
    </m:mi>
   </xsl:when>
   <xsl:otherwise>
-   <xsl:copy-of select="*"/> 
+   <xsl:copy-of select="*"/>
   </xsl:otherwise>
  </xsl:choose>
-<!-- </CSC> -->
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
 
+
 <xsl:template match = "m:csymbol">
-  <xsl:choose>
+   <xsl:choose>
     <xsl:when test="*[1]">
-      <xsl:copy-of select = "*"/>
+     <xsl:copy-of select = "*"/>
     </xsl:when>
-    <xsl:otherwise>
-      <m:mo> <xsl:apply-templates mode = "semantics"/> </m:mo>
-    </xsl:otherwise>
+   <xsl:otherwise>
+    <m:mo> <xsl:apply-templates mode = "semantics"/> </m:mo>
+   </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
 
   </xsl:apply-templates>
   <xsl:if test="*[3]">
     <xsl:for-each select = "*[position()>2]">
-<!-- HELM: MODIFICA PROVVISORIA -->
+<!-- HELM: to distinguish between * and the application -->
 <!--      <m:mo><xsl:call-template name="insert2"/>
                 <mchar name="InvisibleTimes"/> </m:mo> -->
       <m:mo><xsl:call-template name="insert2"/>*</m:mo>
   </xsl:if>
 </xsl:template>
 
-<!-- HELM: COMMENTO : dove metto la uri della definizione di radice ???? -->
 
 <xsl:template match = "m:apply[m:root[1]]">
   <m:msqrt>
+    <xsl:call-template name="insert1"/>
     <xsl:call-template name="insert_xref"/>
     <xsl:if test="*[2]=m:degree">
       <xsl:apply-templates select="*[3]" mode = "semantics"/>