W3C home > Mailing lists > Public > www-math@w3.org > November 2003

Bugs in ctop.xsl

From: Alexey Shamrin <shamrin@mail.ru>
Date: Tue, 11 Nov 2003 03:17:36 +0300
Message-ID: <917453292.20031111031736@mail.ru>
To: www-math@w3.org
Cc: davidc@nag.co.uk

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 20 February 2010 06:12:55 GMT