7.1 Mstyle as Parent of an Element
Merge mstyle into its child. For instance
<mstyle mathvariant="bold">
<mi>F</mi>
</mstyle>
into
<mi mathvariant="bold">F</mi>
<xsl:template match=" m:mstyle [
@mathvariant
and
child::m:*[ not(@mathvariant) ]
and
(count(child::m:*) = 1)
] " >
<xsl:element name="{name(child::m:*[1])}">
<xsl:attribute name="mathvariant" >
<xsl:value-of select="@mathvariant" />
</xsl:attribute>
<xsl:apply-templates select="child::m:*/@*" />
<xsl:apply-templates select="
child::m:*/*
| child::m:*/text()
| child::m:*/comment()
"
/>
</xsl:element>
</xsl:template>
-_-_-