8.6 Prepend Existing Continued Fractions

<..prepend continued fractions..>
 <xsl:when test="
       self::mfrac
     and
       child::mrow[ @class = ’mrow-enumerator’ ]
         / child::mfrac[ @class = ’continued-mfrac’ ]
     and
       ( normalize-space(
           child::mrow[ @class = ’mrow-numerator’ ]
         )
         =
         normalize-space(
           child::mrow[ @class = ’mrow-enumerator’ ]
            / child::mfrac[ @class = ’continued-mfrac’ ]
            / child::mrow[ @class = ’mrow-numerator’ ]
         )
       )
     and <.check equality of op with cont frac.>
 " >
   <.a,b := cont top 2 pre op values.>
   <xsl:choose>
      <xsl:when test="
          normalize-space($a)=normalize-space($b)
      " >
          <xsl:attribute name="class">
             <xsl:value-of select=" ’continued-mfrac’ " />
          </xsl:attribute>
          <xsl:apply-templates select="*|text()|comment()" />
      </xsl:when>
      <xsl:otherwise>
          <xsl:apply-templates select="*|@*|text()|comment()" />
      </xsl:otherwise>
   </xsl:choose>
 </xsl:when>
-_-_-

<..check equality of op with cont frac..>
 (
    normalize-space(
    child::span[ @class = ’mrow-enumerator’ ] /
    child::mfrac /
    preceding-sibling::*[1] )
    =
    normalize-space(
    child::span[ @class = ’mrow-enumerator’ ] /
    child::mfrac /
    child::span[ @class = ’mrow-enumerator’ ] /
    child::span[ @class = ’continued-mfrac’ ] /
    preceding-sibling::*[1] )
 )
-_-_-

<..a,b := cont top 2 pre op values..>
 <xsl:variable name="a">
    <xsl:apply-templates select="
          child::span[ @class = ’mrow-enumerator’ ] /
          child::span[ @class = ’mcontinued-mfrac’ ] /
          preceding-sibling::*[2]
    "  mode="enum-op" />
 </xsl:variable>
 <xsl:variable name="b">
    <xsl:apply-templates select="
          child::span[ @class = ’mrow-enumerator’ ] /
          child::span[ @class = ’mcontinued-mfrac’ ] /
          child::span[ @class = ’mrow-enumerator’ ] /
          child::span[
            self::mfrac or (@class = ’mcontinued-mfrac’)
          ] /
          preceding-sibling::*[2]
    "  mode="enum-op" />
 </xsl:variable>
-_-_-