11.3 Short Cuts for Math Overline
<xsl:template match="mover[
(@class = ’mover-overline’)
and
child::mrow[
(@class = ’mo-00AF’)
and
descendant::mi
]
]" >
<xsl:variable name="content">
<xsl:apply-templates select="*" mode="content" />
</xsl:variable>
<xsl:choose>
<xsl:when test="
string-length( normalize-space( $content )) = 1
" >
<.set mover short cut.>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*" />
<xsl:apply-templates
select="*|text()|comment()" />
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template> -_-_-
The following code makes to push the mover’s under the munder’s.
<BREAK SIZE="small"/>
<xsl:choose>
<xsl:when test="child::mrow / child::munder">
<xsl:apply-templates select="child::mrow / child::munder"
mode="under-munder" />
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*" />
<xsl:apply-templates
select=" *[ @class != ’begin-end’ ] " />
<.mover bar short cut.>
</xsl:copy>
</xsl:otherwise>
</xsl:choose> -_-_-
<xsl:template match="*" mode="under-munder" >
<xsl:choose>
<xsl:when test="self::munder">
<xsl:copy>
<xsl:apply-templates select="@*" />
<xsl:apply-templates select="*" mode="under-munder" />
</xsl:copy>
</xsl:when>
<xsl:when test="self::mrow[ parent::munder ]">
<xsl:copy>
<xsl:apply-templates select="@*" />
<.cont under-munder.>
</xsl:copy>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." />
</xsl:otherwise>
</xsl:choose>
</xsl:template> -_-_-
<xsl:choose>
<xsl:when test="child::munder">
<xsl:apply-templates select="*" mode="under-munder" />
</xsl:when>
<xsl:otherwise>
<mover class="mover-overline">
<mrow class="mo-00AF">
<xsl:apply-templates select="*" />
</mrow>
<.mover bar short cut.>
</mover>
</xsl:otherwise>
</xsl:choose> -_-_-
<span class="begin-end" title="speech-extra" >
<BREAK SIZE="small"/>
<xsl:text> over bar </xsl:text>
<BREAK SIZE="small"/>
</span>
-_-_-
<mover class="mover-overline">
<span class="begin-end" title="speech-extra"> modified above </span>
<mrow class="mo-00AF">
<span class="mathvariant-bold">
<span title="speech-extra" class="begin-end"> bold </span>
<mi class="mi">
<span title="speech-extra"
class="capital-description"> capital </span>
Z
</mi>
</span>
</mrow>
<span class="begin-end" title="speech-extra"> with bar </span>
</mover>