<!-- Added the namespace prefix to all the xref attributes -->
<!-- Changed the mml prefix into m -->
<!-- Added m:xref to every mo element -->
+<!-- Changed mchar into the corresponding entity -->
<!-- First draft: April 27 2001, Irene Schena -->
<!-- ====================================================== -->
<xsl:param name="PAREN" select="$PAR_NO"/>
<xsl:param name="PAR_NO_IGNORE" select="$YES"/>
<!-- HELM: added -->
+<!-- CSC
<xsl:choose>
<xsl:when test="child::text()">
+-->
<!-- HELM -->
<xsl:choose>
<xsl:when test=". < 0 and $IN_PREC > $NO_PREC and $PAREN=$PAR_NO
</xsl:otherwise>
</xsl:choose>
<!-- HELM: added -->
+<!--CSC
</xsl:when>
<xsl:otherwise>
<m:mrow>
</m:mrow>
</xsl:otherwise>
</xsl:choose>
+-->
<!-- HELM -->
</xsl:template>
<m:mo>+</m:mo>
<m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
</xsl:if>
- <m:mo> <m:mchar name="InvisibleTimes"/> </m:mo>
+ <m:mo>⁢</m:mo>
<m:mo>i</m:mo>
</m:mfenced>
</xsl:when>
<m:mo>+</m:mo>
<m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
</xsl:if>
- <m:mo> <m:mchar name="InvisibleTimes"/> </m:mo>
+ <m:mo>⁢</m:mo>
<m:mo>i</m:mo>
</m:mfenced>
<m:mn> <xsl:value-of select="@base"/> </m:mn>
<xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
<m:mrow>
<m:mo>Polar</m:mo>
- <m:mo> <m:mchar name="InvisibleTimes"/> </m:mo>
+ <m:mo>⁢</m:mo>
<m:mfenced separators=",">
<m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
<m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
<m:msub>
<m:mrow>
<m:mo>Polar</m:mo>
- <m:mo> <m:mchar name="InvisibleTimes"/> </m:mo>
+ <m:mo>⁢</m:mo>
<m:mfenced separators=",">
<m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
<m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
<m:mn> <xsl:value-of select="@base"/> </m:mn>
</m:msub>
</xsl:when>
- <xsl:otherwise>
+ <xsl:otherwise>
+<!--HELM: Was:
+ <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
+HELM: Now is: -->
+ <xsl:choose>
+ <xsl:when test="child::text() and not(*[1])">
<m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
- </xsl:otherwise>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="not(*[2])">
+ <xsl:copy-of select="*[1]"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <m:mrow>
+ <xsl:copy-of select="*|text()"/>
+ </m:mrow>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+<!-- HELM -->
+ </xsl:otherwise>
</xsl:choose>
</xsl:template>
<m:mo>+</m:mo>
<m:mn> <xsl:value-of select="text()[2]"/> </m:mn>
</xsl:if>
- <m:mo> <m:mchar name="InvisibleTimes"/> </m:mo>
+ <m:mo>⁢</m:mo>
<m:mo>i</m:mo>
</m:mfenced>
</xsl:when>
<m:mo>+</m:mo>
<m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
</xsl:if>
- <m:mo> <m:mchar name="InvisibleTimes"/> </m:mo>
+ <m:mo>⁢</m:mo>
<m:mo>i</m:mo>
</m:mfenced>
<m:mn> <xsl:value-of select="@base"/> </m:mn>
<xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
<m:mrow m:xref="{@id}">
<m:mo>Polar</m:mo>
- <m:mo> <m:mchar name="InvisibleTimes"/> </m:mo>
+ <m:mo>⁢</m:mo>
<m:mfenced separators=",">
<m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
<m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
<m:msub m:xref="{@id}">
<m:mrow>
<m:mo>Polar</m:mo>
- <m:mo> <m:mchar name="InvisibleTimes"/> </m:mo>
+ <m:mo>⁢</m:mo>
<m:mfenced separators=",">
<m:mn> <xsl:apply-templates select="text()[1]"/> </m:mn>
<m:mn> <xsl:apply-templates select="text()[2]"/> </m:mn>
<m:mn> <xsl:value-of select="@base"/> </m:mn>
</m:msub>
</xsl:when>
- <xsl:otherwise>
- <m:mn m:xref="{@id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
- </xsl:otherwise>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="child::text() and not(*[1])">
+ <m:mn m:xref="{$id}"> <xsl:apply-templates mode = "semantics"/> </m:mn>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="id" select="@id"/>
+ <xsl:choose>
+ <xsl:when test="not(*[2])">
+ <xsl:for-each select="*[1]">
+ <xsl:copy>
+ <xsl:attribute name="m:xref">
+ <xsl:value-of select="$id"/>
+ </xsl:attribute>
+ <xsl:copy-of select="@*|*"/>
+ </xsl:copy>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <m:mrow m:xref="{$id}">
+ <xsl:copy-of select="*|text()"/>
+ </m:mrow>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- HELM: ci could not contain MAthML presentation -->
<xsl:template match = "m:ci">
-<!-- HELM: added -->
-<xsl:choose>
- <xsl:when test="child::text()">
<!-- HELM -->
<xsl:choose>
<xsl:when test="@type='vector' or @type=matrix or @type=set">
</m:mrow>
</xsl:if>
<xsl:if test="not(*[2])">
+<!--HELM: Was:
<xsl:apply-templates select="*[1]"/>
+HELM: Now is: -->
+ <xsl:variable name="id" select="@id"/>
+ <xsl:for-each select="*[1]">
+ <xsl:copy>
+ <xsl:attribute name="m:xref">
+ <xsl:value-of select="$id"/>
+ </xsl:attribute>
+ <xsl:copy-of select="@*|*"/>
+ </xsl:copy>
+ </xsl:for-each>
+<!-- HELM -->
</xsl:if>
</xsl:otherwise>
</xsl:choose>
-<!-- HELM: added -->
-</xsl:when>
- <xsl:otherwise>
- <m:mrow>
- <xsl:copy-of select="*"/>
- <xsl:attribute name="m:xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </m:mrow>
- </xsl:otherwise>
- </xsl:choose>
<!-- HELM -->
</xsl:template>
<xsl:attribute name="m:xref">
<xsl:value-of select="m:fn/@id"/>
</xsl:attribute>
- </xsl:if>
- <m:mchar name='ApplyFunction'/> </m:mo>
+ </xsl:if>⁡</m:mo>
<m:mfenced separators=",">
<xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
</m:mfenced>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select = "*[1]" mode = "semantics"/>
- <m:mo> <m:mchar name='ApplyFunction'/> </m:mo>
+ <m:mo>⁡</m:mo>
<m:mfenced separators=",">
<xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
</m:mfenced>
<xsl:value-of select="@id"/>
</xsl:attribute>
</xsl:if>
- <m:mo> <m:mchar name='Lambda'/> </m:mo>
- <m:mo> <m:mchar name='ApplyFunction'/> </m:mo>
+ <m:mo>Λ</m:mo>
+ <m:mo>⁡</m:mo>
<m:mfenced separators=",">
<xsl:for-each select = "*">
<xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select = "*[1]" mode = "semantics"/>
- <m:mo> <m:mchar name='ApplyFunction'/> </m:mo>
+ <m:mo>⁡</m:mo>
<m:mfenced separators=",">
<xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
</m:mfenced>
<xsl:attribute name="m:xref">
<xsl:value-of select="../m:compose/@id"/>
</xsl:attribute>
- </xsl:if>
- <m:mchar name="SmallCircle"/> </m:mo>
+ </xsl:if>∘</m:mo>
<xsl:apply-templates select = "." mode="semantics"/>
</xsl:for-each>
</m:mfenced>
<xsl:value-of select="@id"/>
</xsl:attribute>
</xsl:if>
- <m:mo form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em">
- <m:mchar name="LeftFloor"/>
- </m:mo>
+ <m:mo form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em">⌊</m:mo>
<m:mfrac>
<!-- HELM: added -->
<xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
</xsl:apply-templates>
</m:mrow>
</m:mfrac>
- <m:mo form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em">
- <m:mchar name="LeftFloor"/>
- </m:mo>
+ <m:mo form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em">⌊</m:mo>
</m:mrow>
</xsl:template>
<xsl:if test="*[3]">
<xsl:for-each select = "*[position()>2]">
<!-- HELM: to distinguish between * and the application -->
-<!-- <m:mo> <mchar name="InvisibleTimes"/> </m:mo> -->
+<!-- <m:mo>⁢</m:mo> -->
<m:mo>
<!-- HELM: added -->
<xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
<xsl:attribute name="m:xref">
<xsl:value-of select="../m:and/@id"/>
</xsl:attribute>
- </xsl:if>
- <m:mchar name="wedge"/></m:mo>
+ </xsl:if>∧</m:mo>
<xsl:apply-templates select="." mode = "semantics">
<xsl:with-param name="IN_PREC" select="$AND_PREC"/>
<xsl:with-param name="PAREN" select="$PAREN"/>
<xsl:attribute name="m:xref">
<xsl:value-of select="../m:or/@id"/>
</xsl:attribute>
- </xsl:if>
- <m:mchar name="vee"/> </m:mo>
+ </xsl:if>∨</m:mo>
<xsl:apply-templates select="." mode = "semantics">
<xsl:with-param name="IN_PREC" select="$OR_PREC"/>
<xsl:with-param name="PAREN" select="$PAREN"/>
<xsl:attribute name="m:xref">
<xsl:value-of select="../m:xor/@id"/>
</xsl:attribute>
- </xsl:if>
- <m:mchar name="xor"/> </m:mo>
+ </xsl:if>⊻</m:mo>
<xsl:apply-templates select="." mode = "semantics">
<xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
<xsl:with-param name="PAREN" select="$PAREN"/>
<xsl:attribute name="m:xref">
<xsl:value-of select="m:not/@id"/>
</xsl:attribute>
- </xsl:if><m:mchar name="not"/></m:mo>
+ </xsl:if>¬</m:mo>
<xsl:apply-templates select = "*[2]" mode = "semantics">
<xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
</xsl:apply-templates>
<xsl:attribute name="m:xref">
<xsl:value-of select="m:exists/@id"/>
</xsl:attribute>
- </xsl:if>
- <m:mchar name="Exists"/> </m:mo>
+ </xsl:if>∃</m:mo>
<xsl:if test="count(m:bvar) > 1">
<m:mfenced separators=",">
<xsl:for-each select = "m:bvar">
<xsl:attribute name="m:xref">
<xsl:value-of select="m:conjugate/@id"/>
</xsl:attribute>
- </xsl:if>
- <m:mchar name="UnderBar"/> </m:mo>
+ </xsl:if>̲</m:mo>
</m:mover>
</xsl:template>
<xsl:value-of select="m:neq/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="NotEqual"/>
+ ≠
</xsl:if>
<xsl:if test="*[1]=m:approx">
<!-- HELM: added -->
<xsl:value-of select="m:approx/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="approxeq"/>
+ ≊
</xsl:if>
<xsl:if test="*[1]=m:tendsto">
<!-- HELM: added -->
<xsl:value-of select="m:tendsto/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="RightArrow"/>
+ →
</xsl:if>
<xsl:if test="*[1]=m:implies">
<!-- HELM: added -->
<xsl:value-of select="m:implies/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="DoubleRightArrow"/>
+ ⇒
</xsl:if>
<xsl:if test="*[1]=m:in">
<!-- HELM: added -->
<xsl:value-of select="m:in/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="Element"/>
+ ∈
</xsl:if>
<xsl:if test="*[1]=m:notin">
<!-- HELM: added -->
<xsl:value-of select="m:notin/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="NotElement"/>
+ ∉
</xsl:if>
<xsl:if test="*[1]=m:notsubset">
<!-- HELM: added -->
<xsl:value-of select="m:notsubset/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="NotSubset"/>
+ ⊄
</xsl:if>
<xsl:if test="*[1]=m:notprsubset">
<!-- HELM: added -->
<xsl:value-of select="m:notprsubset/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="NotSubsetEqual"/>
+ ⊈
</xsl:if>
</m:mo>
<xsl:apply-templates select = "*[3]" mode = "semantics"/>
<xsl:value-of select="../m:subset/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="SubsetEqual"/>
+ ⊆
</xsl:if>
<xsl:if test="../*[self::m:prsubset][1]">
<!-- HELM: added -->
<xsl:value-of select="../m:prsubset/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="subset"/>
+ ⊂
</xsl:if>
<xsl:if test="../*[self::m:eq][1]">
<!-- HELM: added -->
<xsl:value-of select="../m:geq/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="geq"/>
+ ≥
</xsl:if>
<xsl:if test="../*[self::m:leq][1]">
<!-- HELM: added -->
<xsl:value-of select="../m:leq/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="leq"/>
+ ≤
</xsl:if>
<xsl:if test="../*[self::m:equivalent][1]">
<!-- HELM: added -->
<xsl:value-of select="../m:equivalent/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="Congruent"/>
+ ≡
</xsl:if>
</m:mo>
<xsl:apply-templates select = "." mode="semantics"/>
</xsl:if>ln</m:mo>
</xsl:otherwise>
</xsl:choose>
- <m:mo> <m:mchar name='ApplyFunction'/> </m:mo>
+ <m:mo>⁡</m:mo>
<xsl:apply-templates select = "*[2]" mode = "semantics">
<xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
</xsl:apply-templates>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
- <m:mo> <m:mchar name='ApplyFunction'/> </m:mo>
+ <m:mo>⁡</m:mo>
<xsl:if test="*[2]=m:logbase">
<xsl:apply-templates select = "*[3]" mode = "semantics">
<xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
<xsl:value-of select="m:laplacian/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mo> <m:mchar name="Delta"/> </m:mo>
+ <m:mo>Δ</m:mo>
<m:mn>2</m:mn>
</m:msup>
<xsl:apply-templates select = "*[2]" mode = "semantics"/>
<xsl:attribute name="m:xref">
<xsl:value-of select="../m:union/@id"/>
</xsl:attribute>
- </xsl:if>
- <m:mchar name="Union"/> </m:mo>
+ </xsl:if>⋃</m:mo>
<xsl:apply-templates select = "." mode="semantics">
<xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
<xsl:with-param name="PAREN" select="$PAREN"/>
<xsl:attribute name="m:xref">
<xsl:value-of select="../m:intersect/@id"/>
</xsl:attribute>
- </xsl:if>
- <m:mchar name="Intersection"/> </m:mo>
+ </xsl:if>⋂</m:mo>
<xsl:apply-templates select = "." mode="semantics">
<xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
<xsl:with-param name="PAREN" select="$PAREN"/>
<xsl:value-of select="m:sum/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="Sum"/>
+ ∑
</xsl:if>
<xsl:if test="*[1]=m:product">
<!-- HELM: added -->
<xsl:value-of select="m:product/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="Product"/>
+ ∏
</xsl:if>
</m:mo>
<m:mrow>
<xsl:value-of select="m:sum/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="Sum"/>
+ ∑
</xsl:if>
<xsl:if test="*[1]=m:product">
<!-- HELM: added -->
<xsl:value-of select="m:product/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="Product"/>
+ ∏
</xsl:if>
</m:mo>
<xsl:apply-templates select = "*[3]" mode = "semantics"/>
<m:mrow>
<xsl:if test="*[2]=m:bvar and *[3]=m:lowlimit">
<xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <m:mo> <m:mchar name="RightArrow"/> </m:mo>
+ <m:mo>→</m:mo>
<xsl:apply-templates select = "*[3]" mode = "semantics"/>
</xsl:if>
<xsl:if test="*[2]=m:bvar and *[3]=m:condition">
<xsl:apply-templates select = "../*[3]" mode = "semantics"/>
</m:msup>
</xsl:if>
- <m:mo> <m:mchar name='ApplyFunction'/> </m:mo>
+ <m:mo>⁡</m:mo>
<xsl:apply-templates select = "*[2]" mode = "semantics">
<xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
<xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
<xsl:attribute name="m:xref">
<xsl:value-of select="m:sdev/@id"/>
</xsl:attribute>
- </xsl:if>
- <m:mchar name="sigma"/> </m:mo>
+ </xsl:if>σ</m:mo>
<m:mfenced separators=",">
<xsl:for-each select = "*[position()>1]">
<xsl:apply-templates select = "." mode="semantics"/>
<xsl:attribute name="m:xref">
<xsl:value-of select="m:variance/@id"/>
</xsl:attribute>
- </xsl:if>
- <m:mchar name="sigma"/> </m:mo>
+ </xsl:if>σ</m:mo>
<m:msup>
<m:mfenced separators=",">
<xsl:for-each select = "*[position()>1]">
<xsl:value-of select="m:vectorproduct/@id"/>
</xsl:attribute>
</xsl:if>
- <m:mchar name="Cross"/>
+ ⨯
</xsl:if>
<xsl:if test="m:scalarproduct[1] | m:outerproduct[1]">
<!-- HELM: added -->