B
BakedBean
Hi,
This is probably really simple, but I've only just been asked to look
at this and I've spent a full day trying to get it to work, so any help
will be very gratefully received!
At present I have an HTML page which calls a series of javascript
functions which output text into a browser. A client then asked if it
was possible to output mathematical equations instead of just plain
text! The solution I originally came up with was the MathML was set in
a javascript variable, displayed via the HTML page and the user needed
to download MathPlayer to be able to see the equation correctly.
However, because the clients users may access the pages from computers
where they can't install plug ins, if possible I need a solution that
won't require a plug in to work!!!!
That's when I came across the suggestions on the W3C site and created
the following simple example following the instructions on the site:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="pmathml.xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<h1>Example</h1>
....
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>x</mi><mo>+</mo><mn>3</mn>
</math>
<br/><br/>
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<mrow>
<mn>5</mn>
<msqrt><mrow><mo>-</mo><mn>1</mn></mrow></msqrt>
</mrow>
</math>
<script type="text/javascript" language="javascript">
document.write("<br/><br/>simple text<br/><br/>");
document.write("<math
xmlns='http://www.w3.org/1998/Math/MathML'><mrow><mn>5</mn><msqrt><mrow><mo>-</mo><mn>1</mn></mrow></msqrt></mrow></math>");
</script>
</body>
</html>
as an XHTML page. In the above example the first 2 bits of MathML are
displayed correctly, but the MathML displayed using the document.write
is not! Therefore, have I missed something? Is this possible? Does it
need to be an XHTML page or can I 'embed' this into my existing HTML
page?
Cheers
Matt
This is probably really simple, but I've only just been asked to look
at this and I've spent a full day trying to get it to work, so any help
will be very gratefully received!
At present I have an HTML page which calls a series of javascript
functions which output text into a browser. A client then asked if it
was possible to output mathematical equations instead of just plain
text! The solution I originally came up with was the MathML was set in
a javascript variable, displayed via the HTML page and the user needed
to download MathPlayer to be able to see the equation correctly.
However, because the clients users may access the pages from computers
where they can't install plug ins, if possible I need a solution that
won't require a plug in to work!!!!
That's when I came across the suggestions on the W3C site and created
the following simple example following the instructions on the site:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="pmathml.xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<h1>Example</h1>
....
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>x</mi><mo>+</mo><mn>3</mn>
</math>
<br/><br/>
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<mrow>
<mn>5</mn>
<msqrt><mrow><mo>-</mo><mn>1</mn></mrow></msqrt>
</mrow>
</math>
<script type="text/javascript" language="javascript">
document.write("<br/><br/>simple text<br/><br/>");
document.write("<math
xmlns='http://www.w3.org/1998/Math/MathML'><mrow><mn>5</mn><msqrt><mrow><mo>-</mo><mn>1</mn></mrow></msqrt></mrow></math>");
</script>
</body>
</html>
as an XHTML page. In the above example the first 2 bits of MathML are
displayed correctly, but the MathML displayed using the document.write
is not! Therefore, have I missed something? Is this possible? Does it
need to be an XHTML page or can I 'embed' this into my existing HTML
page?
Cheers
Matt