Bugs in ctop.xsl

Hello!

There're bugs in http://www.w3.org/Math/XSL/ctop.xsl.

1. <limit/>

Example:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <apply> <limit/>
  </apply>
</math>

This   example  renders  as  "limit"  instead  of  just  "lim"  as  in
http://www.w3.org/TR/MathML2/.

2. <bvar> in <sum/> and <product/>

Example:

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <apply> <sum/>
    <bvar> <ci> x </ci> </bvar>
    <lowlimit> <cn> 0 </cn> </lowlimit>
    <uplimit> <ci> n </ci> </uplimit>
    <apply><sin/>
      <ci> x </ci>
    </apply>
  </apply>
</math>

The   above   example   renders   as   (tested   in   latest  Mozilla)
$\sum_{0}^{n}sin(x)$  instead  of  $\sum_{x=0}^{n}sin(x)$.  As you can
see, <bvar> tag is simply ignored.

The same happens in <apply> <product/> ... </apply>.

I suggest to fix it the following way:

--- ctop.xsl    2002-09-20 10:41:40.000000000 +0400
+++ ctop_new.xsl        2003-11-11 03:03:18.000000000 +0300
@@ -910,25 +910,43 @@
  <mml:mrow>
  <mml:msubsup>
   <mml:mo>&#8721;<!--sum--></mml:mo>
- <mml:mrow><xsl:apply-templates mode="c2p" select="mml:lowlimit/*|mml:interval/*[1]|mml:condition/*"/></mml:mrow>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:lowlimit|mml:interval/*[1]|mml:condition/*"/></mml:mrow>
  <mml:mrow><xsl:apply-templates mode="c2p" select="mml:uplimit/*|mml:interval/*[2]"/></mml:mrow>
  </mml:msubsup>
  <xsl:apply-templates mode="c2p" select="*[last()]"/>
 </mml:mrow>
 </xsl:template>
 
+<xsl:template mode="c2p" match="mml:apply[mml:sum]/mml:lowlimit" priority="3">
+<mml:mrow>
+<xsl:apply-templates mode="c2p" select="../mml:bvar/node()"/>
+<mml:mo>=</mml:mo>
+<xsl:apply-templates mode="c2p"/>
+</mml:mrow>
+</xsl:template>
+
+
 <!-- 4.4.7.2 product -->
 <xsl:template mode="c2p" match="mml:apply[*[1][self::mml:product]]">
  <mml:mrow>
  <mml:msubsup>
   <mml:mo>&#8719;<!--product--></mml:mo>
- <mml:mrow><xsl:apply-templates mode="c2p" select="mml:lowlimit/*|mml:interval/*[1]|mml:condition/*"/></mml:mrow>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:lowlimit|mml:interval/*[1]|mml:condition/*"/></mml:mrow>
  <mml:mrow><xsl:apply-templates mode="c2p" select="mml:uplimit/*|mml:interval/*[2]"/></mml:mrow>
  </mml:msubsup>
  <xsl:apply-templates mode="c2p" select="*[last()]"/>
 </mml:mrow>
 </xsl:template>
 
+<xsl:template mode="c2p" match="mml:apply[mml:product]/mml:lowlimit" priority="3">
+<mml:mrow>
+<xsl:apply-templates mode="c2p" select="../mml:bvar/node()"/>
+<mml:mo>=</mml:mo>
+<xsl:apply-templates mode="c2p"/>
+</mml:mrow>
+</xsl:template>
+
+
 <!-- 4.4.7.3 limit -->
 <xsl:template mode="c2p" match="mml:apply[*[1][self::mml:limit]]">
  <mml:mrow>

-- 
Best regards,
 Alexey                          mailto:shamrin@mail.ru

Received on Monday, 10 November 2003 19:26:20 UTC