Re: [xsl] MathML and XSL

Subject: Re: [xsl] MathML and XSL
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Wed, 13 Nov 2002 22:53:47 +0100
Hello Gerard,

Gerard Milmeister wrote:
On Sat, 2002-11-09 at 22:46, David Carlisle wrote:

<!ENTITY % mathml PUBLIC "-//W3C//DTD MathML 2.0//EN"

as noted in the mathml errata there's an updated dtd in

 <xsl:template match="math">
the mathml dt dthat you've included will default mathml elements in to
the mathml namespace so this will need to be

<xsl:template match="m:math">

where m: is bound in the stylesheet to the mathml namespace

since you just want to copy math and all it's children you can simplify
what you had to

<xsl:template match="m:math"> <xsl:copy-of select"."/> </xsl:template>

In the meantime I found the following solution.

<xsl:stylesheet xmlns:xsl="";

  <xsl:template match="m:*">
    <xsl:element name="{name(.)}"

I think you can remove the attribute 'namespace'. This should remove the namespace declarations on every output element. Instead of
<xsl:element name="{name(.)}"> you can then use <xsl:copy>. And the attribute for-each can be shortened to <xsl:copy-of select="@*"/>.

Does still everything work?


      <xsl:for-each select="@*">
        <xsl:attribute name="{name(.)}">
          <xsl:value-of select="."/>

This seems to work and has the advantage that I may create templates for
certain mathml elements when I would need them.
However, your solution may prove useful...

There is however a difference between the output from xalan (in Cocoon)
and xsltproc.
the xalan is as I would expect, however from xsltproc I get the

<math xmlns="";
overflow="scroll"><msqrt xmlns="";><mi

that is the namespace is included in every tag. Is this correct
and simply redundant or what?

XSL-List info and archive:

Current Thread