<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: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: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>