Re: Questions about MathML...


> Hello,

> I want to use MathML in dynamic page (php).  At the head of my php
> page, I header("Content-type:text/xml"); I don't know whether what I
> have done is right or not, but it can work well in some simple test.
> But.....  When there are some special strings like "±",
> "−", the page cannot pass the xml regular.  Another similar
> problem, I can't use   in the page.

The issue here is that the browser's XML parser needs the definitions
of these entity names in order to process them.  One accomplishes that
by including a DOCTYPE declaration at the beginning of your XHTML page
that references a DTD.  For example:

<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"

or if you put a local copy of the DTD on your server

<!DOCTYPE html 
    PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"

for more details on DTDs and doctypes.

> I have some javascript in the page, it can't pass the xml regular,
> either.
> How to solve them?

Usually, this is just a result of special characters like '<' and '&'
in the JavaScript code needing to be escaped.  Note, however, that
there are some difference between the DOM for and XML document and an
HTML document, so depending on what you are trying to do, you may
actually need to modify your code.


Dr. Robert Miner                      
W3C Math Interest Group Co-Chair                      651-223-2883
Design Science, Inc.   "How Science Communicates"

Received on Thursday, 23 September 2004 21:20:01 UTC