8.1 Simple Sub-Sup (Core Content of Length One)

<..eliminate inline math narrative..>
 <xsl:template match="span[
     (@class = ’inline-math’)
   and
     (count( <.math content element.> ) = 1)
 ]" >
   <xsl:copy>
     <xsl:variable name="content">
        <xsl:apply-templates
            select="<.math content element.>"
              mode="content" />
     </xsl:variable>
     <xsl:choose>
        <xsl:when test="
           string-length( normalize-space( $content )) = 1
        " >
           <xsl:attribute name="class">
              <xsl:text>semi-math</xsl:text>
           </xsl:attribute>
           <xsl:apply-templates select="<.math content element.>" />
        </xsl:when>
        <.simple sub or sup.>
        <xsl:otherwise>
           <xsl:apply-templates select="*|@*|comment()|text()" />
        </xsl:otherwise>
     </xsl:choose>
   </xsl:copy>
 </xsl:template>
-_-_-

<..math content element..>
 child::*[ not(@title) or (@title != ’speech-extra’) ]
-_-_-

<..simple sub or sup..>
 <xsl:when test="  child::*[
      (position() = 2)
    and
      ((@class = ’msub’) or (@class = ’msup’) or (@class = ’msubsup’))
 ]" >
     <xsl:variable name="content">
        <xsl:apply-templates select="child::*[2] / child::*[
                                        @class = ’mrow-base’ ]"
                             mode="content" />
     </xsl:variable>
     <xsl:choose>
        <xsl:when test="
           string-length( normalize-space( $content )) = 1
        " >
           <xsl:attribute name="class">
              <xsl:text>semi-math</xsl:text>
           </xsl:attribute>
           <xsl:apply-templates select="*[2]" />
 
           <span class="end-script" title="speech-extra">
              <xsl:text> baseline </xsl:text>
           </span>
 

       </xsl:when>
        <xsl:otherwise>
           <xsl:apply-templates select="*|@*|comment()|text()" />
        </xsl:otherwise>
     </xsl:choose>
 </xsl:when>
-_-_-
<span class="inline-math">  
  <span class="msub">  
    <span class="mrow-base">  
      <span class="mi">C</span>  
    </span>  
    <span class="mrow-sub">  
      <span class="mi">i</span>  
    </span>  
  </span>  
</span>