Message Boards Message Boards

0
|
9380 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Exporting to HTML vs XML with CDF Player

Posted 10 years ago

Hi,

This is my first post. Thanks in advance for any insight. I have a feeling my problem has a simple solution and I was unable to find anything posted about this issue.

I am exporting a Mathematica notebook using the menu commands File > Save As and then choosing the format to be Web Page (.html) or XML -- XHTML + MathML (.xml). I prefer XML because I prefer the MathML rendering of the mathematics. However, only the HTML version correctly displays the CDF components. The XML version displays nothing but a small gap. The JavaScript code is certainly there.

I am viewing the HTML and XML files with Safari and FireFox. Both give the same results. I have experimented with the XML code without success. I have stripped down my notebook to a single simple Manipulate and still no CDF display for the XML version. Any ideas?

Paul

POSTED BY: Paul Ruud

In the hope that someone has an insight, I have experimented a little to provide more information. First, here is the code of a short XHTML file produced (in part) with Save As in Mathematica:

<?xml version="1.0" encoding="UTF-8"?> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
        "HTMLFiles/xhtml-math11-f.dtd">

<!-- Created with the Wolfram Language : www.wolfram.com -->

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title>
  Calculus Summary
 </title>
</head>

<body>

<p>Introduction</p>

<p>
<script type="text/javascript">
    alert('Hello, world!');
</script>
</p>

<p>Conclusion</p>

<p>
<script type="text/javascript" src="http://www.wolfram.com/cdf-player/plugin/v2.1/cdfplugin.js"></script>
<script type="text/javascript">
var cdf = new cdfplugin();
cdf.embed('HTMLFiles/Calculus Summary_1.cdf', 600, 400);
</script>
</p>

<p>Well, at least this works:</p>

<p>
<embed src="HTMLFiles/Calculus Summary_1.cdf" width="600" height="400"></embed>
</p>

</body>

</html>

I have inserted three paragraphs at the beginning to confirm that JavaScript is working. Following "Conclusion" is the code that Mathematica produces. It does not seem to embed the CDF file successfully. Finally, I placed a simple EMBED instruction that does work for me with FireFox and Safari. Everyone is welcome to try this file with this link. You should be prompted by a "Hello, world!" window and then see one successful embed of the CDF file. If you see two, you are seeing something different from me.

Note that the Mathematica JavaScript for embedding does work (for me) in an HTML file.

Paul

POSTED BY: Paul Ruud
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract