7.4 Font Decorations

<..bold math..>
 <script element="span::mathvariant-bold" >
   <set name="bold" >
      <.open xslt script.>
      <.get content template.>
      <.math bold templates.>
      <.close xslt script.>
   </set>
   <xslt name="." xml="." xsl="bold" />
 </script>
-_-_-

<..math bold templates..>
 <xsl:template match="span[ @class = ’mathvariant-bold’ ]" >
   <xsl:copy>
     <xsl:apply-templates select="@*" />
     <xsl:variable name="content">
        <xsl:apply-templates select="*" mode="content" />
     </xsl:variable>
     <xsl:choose>
        <xsl:when test="
           string-length( normalize-space( $content )) = 1
        " >
           <span class="begin-end" title="speech-extra" >
              <xsl:text> bold </xsl:text>
           </span>
           <xsl:apply-templates select="*|text()|comment()" />
        </xsl:when>
        <xsl:otherwise>
           <span class="begin-end" title="speech-extra" >
              <xsl:text> begin bold </xsl:text>
           </span>
           <xsl:apply-templates select="*|text()|comment()" />
           <span class="begin-end" title="speech-extra" >
              <xsl:text> end bold </xsl:text>
           </span>
        </xsl:otherwise>
     </xsl:choose>
   </xsl:copy>
 </xsl:template>
-_-_-