Hi. I'm trying to understand and use MathML and i've tried some of the examples from the W3C website and none of them are formatting correctly. I've followed the instruction at <!-- m --><a class="postlink" href="http://www.w3.org/Math/XSL/">http://www.w3.org/Math/XSL/</a><!-- m --> and downloaded the four stylesheet files (mathml.xsl, pmathml.xsl, ctop.xsl and pmathmlcss.xsl) to run the .xml file locally. The 4 xsl files and .xml file are in the same directory. I've substituted the code from <!-- m --><a class="postlink" href="http://www.w3.org/TR/2003/REC-MathML2-20031021/chapter2.html#fund.pres">http://www.w3.org/TR/2003/REC-MathML2-2 ... #fund.pres</a><!-- m --> for the actual expression. This is the whole code:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href=http://www.webdeveloper.com/forum/archive/index.php/"mathml.xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>...</head>
<body>
<h1>Example</h1>
....
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mrow>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
<mo>+</mo>
<mrow>
<mn>4</mn>
<mo>⁢</mo>
<mi>x</mi>
</mrow>
<mo>+</mo>
<mn>4</mn>
</mrow>
<mo>=</mo>
<mn>0</mn>
</mrow>
</math>
</body>
</html>
When i try opening the .xml file in IE i get this error message
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
Reference to undefined entity'InvisibleTimes'. Error processing resource 'file:///C:/Documents and Settings/Matthew Panayiotou/Desktop/math.xml'. Line 18, Position 12
<mo>⁢</mo>
-----------^
and a similar error message in Firefox. What seems to be the problem.
Also, is it possible to include MathML in an .htm file which has an xhtml dtd so that instead of opening an .xml file you're opening an .htm file. (irrespective of the fact that an .htm file with an xhtml dtd is simply an xml application)
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href=http://www.webdeveloper.com/forum/archive/index.php/"mathml.xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>...</head>
<body>
<h1>Example</h1>
....
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mrow>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
<mo>+</mo>
<mrow>
<mn>4</mn>
<mo>⁢</mo>
<mi>x</mi>
</mrow>
<mo>+</mo>
<mn>4</mn>
</mrow>
<mo>=</mo>
<mn>0</mn>
</mrow>
</math>
</body>
</html>
When i try opening the .xml file in IE i get this error message
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
Reference to undefined entity'InvisibleTimes'. Error processing resource 'file:///C:/Documents and Settings/Matthew Panayiotou/Desktop/math.xml'. Line 18, Position 12
<mo>⁢</mo>
-----------^
and a similar error message in Firefox. What seems to be the problem.
Also, is it possible to include MathML in an .htm file which has an xhtml dtd so that instead of opening an .xml file you're opening an .htm file. (irrespective of the fact that an .htm file with an xhtml dtd is simply an xml application)