<xsl:template match="tml:n">
<xsl:choose>
<xsl:when test="@name">\<xsl:value-of select="@name"/>
- <xsl:if test="parent::tml:g and following-sibling::tml:n"><xsl:value-of select="' '"/></xsl:if>
+ <xsl:if test="parent::tml:g and following-sibling::tml:i"><xsl:value-of select="' '"/></xsl:if>
</xsl:when>
<xsl:when test="string-length(@val)=1"><xsl:value-of select="@val"/></xsl:when>
<xsl:otherwise>{\rm <xsl:value-of select="@val"/>}</xsl:otherwise>
<xsl:template match="tml:o">
<xsl:choose>
- <xsl:when test="@name">\<xsl:value-of select="@name"/><xsl:value-of select="' '"/></xsl:when>
+ <xsl:when test="@name">\<xsl:value-of select="@name"/>
+ <xsl:if test="parent::tml:g and following-sibling::tml:i"><xsl:value-of select="' '"/></xsl:if>
+ </xsl:when>
<xsl:when test="string-length(@val)=1"><xsl:value-of select="@val"/></xsl:when>
<xsl:otherwise><xsl:value-of select="@val"/></xsl:otherwise>
</xsl:choose>
<xsl:template match="tml:g[@id]">{<xsl:apply-templates select="*"/>}</xsl:template>
+ <xsl:template match="tml:g[count(*)>1]">{<xsl:apply-templates select="*"/>}</xsl:template>
+
<xsl:template match="tml:g">
<xsl:apply-templates select="*"/>
</xsl:template>