Message Boards Message Boards

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

Exporting to HTML vs XML with CDF Player

Posted 10 years ago


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?


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"

<!-- Created with the Wolfram Language : -->

<html xmlns="">
  Calculus Summary



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


<script type="text/javascript" src=""></script>
<script type="text/javascript">
var cdf = new cdfplugin();
cdf.embed('HTMLFiles/Calculus Summary_1.cdf', 600, 400);

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

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



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.


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

Group Abstract Group Abstract