<!-- Added the declaration of the xlink namespace -->
<!-- ====================================================== -->
+<!-- ====================================================== -->
+<!-- June, 2000 - HELM group: -->
+<!-- Added auxiliary function to insert: -->
+<!-- 1) backwards pointers: helm:xref -->
+<!-- 2) references to definitions: xlink:href -->
+<!-- Added call-templates to the functions: -->
+<!-- insert_xref, insert, insert1, insert2 -->
+<!-- ====================================================== -->
+
+
+<!-- HELM: namespace helm added -->
<xsl:stylesheet id="mml2mml"
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:variable name="NEG_PREC" select="13"/>
<xsl:variable name="FUNCTION_PREC" select="99"/>
-<!-- AUXILIARY FUNCTIONS FOR BACKWARD POINTERS AND REFS (by andrea) -->
+<!-- HELM: auxiliary functions for backwards pointers and refs -->
<xsl:template name = "insert_xref">
<xsl:if test="@helm:xref">
</xsl:if>
</xsl:template>
-<!-- for use inside m:apply -->
+<!-- HELM: for use inside m:apply -->
<xsl:template name = "insert1">
<xsl:if test="*[1]/@definitionURL">
<xsl:attribute name="xlink:href">
</xsl:if>
</xsl:template>
-<!-- For use inside "for-each" -->
+<!-- HELM: for use inside "for-each" -->
<xsl:template name = "insert2">
<xsl:if test="../*[1]/@definitionURL">
<xsl:attribute name="xlink:href">
<!-- 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=". < 0 and $IN_PREC > 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>
+<!-- HELM: ci could not contain MathML presentation
<m:mi>
<xsl:call-template name="insert"/>
<xsl:apply-templates mode = "semantics"/>
</m:mi>
+-->
+ <xsl:choose>
+ <!-- HELM: or the opposite test <xsl:when test="*[1]"> -->
+ <xsl:when test="child::text()">
+ <m:mi>
+ <xsl:call-template name="insert"/>
+ <xsl:apply-templates mode = "semantics"/>
+ </m:mi>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="*"/>
+ </xsl:otherwise>
+ </xsl:choose>
</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>
</m:mrow>
</xsl:template>
-<!-- These "semantical" Transformations are REALLY questionable.
+<!-- HELM: these "semantical" Transformations are REALLY questionable.
Andrea -->
<xsl:template match = "m:apply[*[1][self::m:inverse]]">
</xsl:apply-templates>
<xsl:if test="*[3]">
<xsl:for-each select = "*[position()>2]">
-<!-- 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>
-<!-- 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"/>
<xsl:template match = "m:apply[m:not[1]]">
<m:mrow>
<xsl:call-template name="insert_xref"/>
+<!-- CSC, per estetica!
<m:mo><xsl:call-template name="insert1"/>not</m:mo>
+-->
+ <m:mo><xsl:call-template name="insert1"/><m:mchar name="not"/></m:mo>
<xsl:apply-templates select = "*[2]" mode = "semantics">
<xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
</xsl:apply-templates>
</xsl:template>
</xsl:stylesheet>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+