8.4 Continued Fractions Conditions (Rule 69)
1
1 + ---------------------------------------
1
2 + ---------------------------------------
1
2 + ---------------------------------------
2 + ...
The fractions are processed recusrively from inside out. The ‘tail’ is the one to
discover the inner most part of a continued fraction (i.e., the bottom rows). Higher
levels add to the nucleous built already under them.
In Stage 1 the members of the continued fractions are marked as such. In the
second stage they being are procesed.
The minimum conditions here are three un-interrupted levels of fractions.
<mfrac>
<mrow class="mrow-enumerator">
<mn>1</mn>
<mo class="MathClass-bin">...</mo>
<mfrac>
<span class="begin-end" ...>begin fraction</span>
<mrow class="mrow-numerator"> ... </mrow>
<span class="begin-end" ...>over</span>
<mrow class="mrow-enumerator">...</mrow>
<span class="begin-end" ...>end fraction</span>
</mfrac>
<xsl:variable name="a">
<xsl:apply-templates select="
child::mrow[ @class = ’mrow-enumerator’ ] /
child::mfrac /
preceding-sibling::*[2]
" mode="enum-op" />
</xsl:variable>
<xsl:variable name="b">
<xsl:apply-templates select="
child::mrow[ @class = ’mrow-enumerator’ ] /
child::mfrac /
child::mrow[ @class = ’mrow-enumerator’ ] /
child::mfrac /
preceding-sibling::*[2]
" mode="enum-op" />
</xsl:variable>
<xsl:variable name="c">
<xsl:value-of select="
normalize-space(
child::mrow[ @class = ’mrow-enumerator’ ] /
child::mfrac /
child::mrow[ @class = ’mrow-enumerator’ ] /
child::mfrac /
child::mrow[ @class = ’mrow-enumerator’ ] )
" />
</xsl:variable>
-_-_-
<xsl:template match="*" mode="enum-op">
<xsl:if test="preceding-sibling::*" >
<xsl:apply-templates select=" preceding-sibling::*[1] " />
</xsl:if>
<xsl:value-of select="." />
</xsl:template>
-_-_-