]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/xsl/tml-mmlp.xsl
Added the completion of the macro's name.
[helm.git] / helm / DEVEL / mathml_editor / xsl / tml-mmlp.xsl
index 7b225f0e3c1a2f15799e256d90c3634a7ef857db..7b1ad7cb3ca4d9a9d3aace5e06223f19bf85cfac 100644 (file)
     </m:mo>
   </xsl:template>
 
+  <xsl:template match="tml:s">
+<!-- this template is used only for testing purpose and should not be here-->
+    <m:mspace width="veryverythickmathspace">
+      <xsl:if test="@id">
+        <xsl:attribute name="xref">
+          <xsl:value-of select="@id"/>
+        </xsl:attribute>
+      </xsl:if>
+    </m:mspace>
+  </xsl:template>
+
+<!--
+  <xsl:template name="cursor">
+    <xsl:choose>
+      <xsl:when test="contains(@val, '\')">
+        <m:mrow>
+         <xsl:if test="@id">
+           <xsl:attribute name="xref">
+             <xsl:value-of select="@id"/>
+           </xsl:attribute>
+         </xsl:if>
+         <xsl:if test="substring-before(@val, '\')">
+            <m:mtext><xsl:value-of select="substring-before(@val, '\')"/></m:mtext>
+         </xsl:if>
+          <m:mo stretchy="false">&#x2329;</m:mo>
+          <m:mtext mathcolor="blue"><xsl:value-of select="concat('\', substring-after(@val, '\'))"/></m:mtext>
+          <m:mo stretchy="false">&#x232a;</m:mo>
+       </m:mrow>
+      </xsl:when>
+      <xsl:when test="string-length(@val)>=1">
+        <m:mrow>
+         <xsl:if test="@id">
+           <xsl:attribute name="xref">
+             <xsl:value-of select="@id"/>
+           </xsl:attribute>
+         </xsl:if>
+         <xsl:choose>
+           <xsl:when test="contains('0123456789', substring(@val, 1, 1))">
+              <m:mn>
+               <xsl:value-of select="@val"/>
+             </m:mn>
+           </xsl:when>
+           <xsl:otherwise>
+             <m:mi>
+               <xsl:value-of select="@val"/>
+             </m:mi>
+           </xsl:otherwise>
+         </xsl:choose>
+         <m:mtext mathcolor="blue">I</m:mtext>
+       </m:mrow>
+      </xsl:when>
+      <xsl:otherwise>
+        <m:mtext mathcolor="blue">
+         <xsl:if test="@id">
+           <xsl:attribute name="xref">
+             <xsl:value-of select="@id"/>
+           </xsl:attribute>
+         </xsl:if>I</m:mtext>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  -->
+
   <xsl:template match="tml:o[@val='-']">
     <m:mo>
       <xsl:if test="@id">
           <m:mo stretchy="false">&#x232a;</m:mo>
         </m:mrow>
       </xsl:when>
+      <xsl:when test="string-length(@val)>=1">
+        <m:mrow>
+         <xsl:if test="@id">
+           <xsl:attribute name="xref">
+             <xsl:value-of select="@id"/>
+           </xsl:attribute>
+         </xsl:if>
+         <xsl:choose>
+           <xsl:when test="contains('0123456789', substring(@val, 1, 1))">
+              <m:mn>
+               <xsl:value-of select="@val"/>
+             </m:mn>
+           </xsl:when>
+           <xsl:otherwise>
+             <m:mi>
+               <xsl:value-of select="@val"/>
+             </m:mi>
+           </xsl:otherwise>
+         </xsl:choose>
+         <m:mtext mathcolor="blue">I</m:mtext>
+       </m:mrow>
+      </xsl:when>
       <xsl:otherwise>
         <m:mtext mathcolor="blue">
          <xsl:if test="@id">
          </xsl:if><xsl:value-of select="@val"/>I</m:mtext>
       </xsl:otherwise>
     </xsl:choose>
-  </xsl:template>
+  </xsl:template>-->
 
   <xsl:template match="tml:cursor[not(@visible) or @visible='0']">
   </xsl:template>
     </m:mfrac>
   </xsl:template>
 
+  <xsl:template match="tml:c[@name='nodeside']">
+<!-- nodeside  -->
+    <m:mfrac>
+      <xsl:if test="@id">
+        <xsl:attribute name="xref">
+          <xsl:value-of select="@id"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates select="*[1]"/>
+      <xsl:apply-templates select="*[2]"/>
+    </m:mfrac>
+  </xsl:template>
+
   <xsl:template match="tml:c[@name='space']">
     <m:mspace width="veryverythickmathspace">
     </m:mspace>
   </xsl:template>
-
 </xsl:stylesheet>