8.3 Mixed Fractions

Examples: ‘2{3\over 4}’ into ‘2 and three forth’, and ‘10{25\over 39}’ into ‘10 and 25 over 39’.

<..mixed fractions..>
 <xsl:template match="mfrac[
    (
       (translate(
          concat(
            mrow[ (@class = ’mrow-numerator’)],
            mrow[ (@class = ’mrow-enumerator’)]
          )  ,’0123456789’,’’) = ’’)
       and
          not(descendant::*/descendant::*
                           /descendant::mn-group-s)
       or
          (@class = ’word-frac’)
    )
    and
      preceding-sibling::*[1]
        / self::mn-group-s[ child::*[
             (position() = last())
             and
             self::mn
          ] ]
  ]" >
   <xsl:text> and </xsl:text>
   <xsl:copy>
     <xsl:apply-templates select="*|@*|text()|comment()" />
   </xsl:copy>
 </xsl:template>
-_-_-