]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/xsl/tml-mmlp.xsl
debian release 0.0.4-2:
[helm.git] / helm / DEVEL / mathml_editor / xsl / tml-mmlp.xsl
index 8c9b8ead19ca45b35f138f5de16d0b900add3cc2..7b225f0e3c1a2f15799e256d90c3634a7ef857db 100644 (file)
@@ -1,4 +1,31 @@
 <?xml version="1.0"?>
+
+<!--
+ This file is part of EdiTeX, an editor of mathematical
+ expressions based on TeX syntax.
+ Copyright (C) 2002-2003 Luca Padovani <lpadovan@cs.unibo.it>,
+                    2003 Paolo Marinelli <pmarinel@cs.unibo.it>.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+ For more information, please visit the project's home page
+ http://helm.cs.unibo.it/editex/
+ or send an email to <lpadovan@cs.unibo.it>
+-->
+
 <xsl:stylesheet
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
      xmlns:tml="http://helm.cs.unibo.it/2002/TML"
     </m:mo>
   </xsl:template>
 
-  <xsl:template name="cursor">
+  <xsl:template match="tml:cursor[@visible='1']">
     <xsl:choose>
       <xsl:when test="substring(@val,1,1)='\'">
         <m:mrow>
            <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[@visible='1']">
-    <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:if><xsl:value-of select="@val"/>I</m:mtext>
       </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:with-param name="annotation" select="$annotation"/>
-       </xsl:apply-templates>
+        <xsl:apply-templates select="*[1]"/>
       </xsl:when>
       <xsl:when test="tml:cursor">
        <m:mstyle mathbackground="#e0e0e0">
             </xsl:attribute>
          </xsl:if>
          <m:mrow>
-           <xsl:apply-templates select="*">
-             <xsl:with-param name="annotation" select="$annotation"/>
-           </xsl:apply-templates>
+           <xsl:apply-templates select="*"/>
          </m:mrow>
        </m:mstyle>
       </xsl:when>
               <xsl:value-of select="@id"/>
             </xsl:attribute>
          </xsl:if>
-         <xsl:apply-templates select="*">
-           <xsl:with-param name="annotation" select="$annotation"/>
-         </xsl:apply-templates>
+         <xsl:apply-templates select="*"/>
        </m:mrow>
       </xsl:otherwise>
     </xsl:choose>
     </m:mfrac>
   </xsl:template>
 
+  <xsl:template match="tml:c[@name='space']">
+    <m:mspace width="veryverythickmathspace">
+    </m:mspace>
+  </xsl:template>
+
 </xsl:stylesheet>