This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Pass-Through of MathML-Elements


Haven't read over all your post here, but you might be interested in
looking at the following http://www.w3.org/Math/XSL/Overview-tech.html
something that David Carlisle recently posted to this list for xslt for
MathMl.

-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com] On Behalf Of Maik
Stührenberg
Sent: Tuesday, May 14, 2002 11:51 AM
To: XSL-List@lists.mulberrytech.com
Subject: [xsl] Pass-Through of MathML-Elements

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



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]