[xsl] Pass-Through of MathML-Elements

Subject: [xsl] Pass-Through of MathML-Elements
From: Maik Stührenberg <Maik.Stuehrenberg@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 14 May 2002 11:51:12 +0200
Hello,
I use a DTD for XML documents which allows the use of MathML 2.0 Elements wrapped in the element Formula:


<!ENTITY % MATHML.prefixed "INCLUDE">
<!ENTITY % MATHML.prefix "mml">
<!ENTITY % math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd";>
%math;
<!ELEMENT Formula (%math.qname;)*>
<!ATTLIST Formula xmlns:mml CDATA #FIXED "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd"; Display (Block | Inline) "Inline">


A XML sample file could contain some MathML elements:
...
<Content>
</Text>
<Paragraph>This is an example text.
<Formula xmln:mml="http://www.w3.org/TR/MathML2/dtd/mathml2.dtd";>
<mml:math>
<mml:row>
...
</mml:row>
</mml:math
</Formula>
</Paragraph>
</Text>
</Content>
...

The XML source is transformed to HTML with a XSL Stylesheet with Instant Saxon 6.5.2. The embedded MathML elements shall be passed through with a result like this:
<html>
<head>
</head>
<body>
...
<mml:math>
<mml:row>
...
</mml:row>
</mml:math>
...
</body>
</html>


If I try to use the following stylesheet the MathML elements will be transformed to HTML (XSL version 1.1 is used to use the xsl:document with Saxon).

<?xml version="1.0"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="html" doctype-system="http://www.w3.org/TR/html4/loose.dtd"; doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" encoding="ISO-8859-1" indent="yes"/>
...
<xsl:template match="Formula">
<xsl:choose>
<xsl:when test="@Display='Block'">
<blockquote>
<xsl:value-of select="."/>
</blockquote>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
...
</xsl:stylesheet>


The same problem still with the XHTML and MathML and SVG Profile from W3C (http://www.w3.org/TR/2002/WD-XHTMLplusMathMLplusSVG-20020430/xhtml-math-svg.html), all MathML elements will be transformed.

<?xml version="1.0"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="xml" doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"; doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" encoding="UTF-8" indent="yes"/>


I thought the default rule for XSLT processors is to pass the output through so I deleted the whole Formula template - same result. What output parameter, encoding or template do I need to define to get MathML elements pass through?
Kind regards,


Maik Stührenberg


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread