]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/xsl/tml-mmlp.xsl
* code cleanup
[helm.git] / helm / DEVEL / mathml_editor / xsl / tml-mmlp.xsl
index 034c5073a1920e147d3b20f8f75573fa191279ae..9054b9c997ffbaf020b6378f819c373384ed3fbd 100644 (file)
@@ -68,7 +68,7 @@
     </m:mo>
   </xsl:template>
 
-  <xsl:template match="tml:cursor">
+  <xsl:template name="cursor">
     <xsl:choose>
       <xsl:when test="substring(@val,1,1)='\'">
         <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>
-         <xsl:value-of select="@val"/>
-       </m:mtext>
+         <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:cursor">
+    <xsl:param name="annotation" select="/.."/>
+    <xsl:choose>
+      <xsl:when test="$annotation">
+        <m:msub>
+         <xsl:call-template name="cursor"/>
+         <m:mtext>
+           <xsl:value-of select="$annotation"/>
+         </m:mtext>
+       </m:msub>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="cursor"/>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
   </xsl:template>
 
   <xsl:template match="tml:g">
+    <xsl:param name="annotation" select="/.."/>
     <xsl:choose>
       <xsl:when test="not(@id) and count(*) = 1">
-        <xsl:apply-templates select="*[1]"/>
+        <xsl:apply-templates select="*[1]">
+         <xsl:with-param name="annotation" select="$annotation"/>
+       </xsl:apply-templates>
       </xsl:when>
       <xsl:when test="tml:cursor">
        <m:mstyle mathbackground="#e0e0e0">
             </xsl:attribute>
          </xsl:if>
          <m:mrow>
-           <xsl:apply-templates select="*"/>
+           <xsl:apply-templates select="*">
+             <xsl:with-param name="annotation" select="$annotation"/>
+           </xsl:apply-templates>
          </m:mrow>
        </m:mstyle>
       </xsl:when>
               <xsl:value-of select="@id"/>
             </xsl:attribute>
          </xsl:if>
-         <xsl:apply-templates select="*"/>
+         <xsl:apply-templates select="*">
+           <xsl:with-param name="annotation" select="$annotation"/>
+         </xsl:apply-templates>
        </m:mrow>
       </xsl:otherwise>
     </xsl:choose>
         </xsl:attribute>
       </xsl:if>
       <xsl:apply-templates select="*[1]"/>
+      <xsl:if test="tml:g/tml:cursor">
+        <m:msub>
+          <m:mtext mathcolor="#808080">}</m:mtext>
+         <m:mtext><xsl:value-of select="@name"/></m:mtext>
+        </m:msub>
+      </xsl:if>
     </m:mstyle>
   </xsl:template>