Forum Bugs

Prince 9 MathML problem

DanielPharos
I had trouble before with Prince 8.1 rev 5 getting this to work (I had to modify the DTD file), but with Prince 9, I'm still having trouble. I've got an XHTML file using MathML, and when trying to put it through Prince, I get an error:

prince: /usr/local/lib/prince/license/license.dat: warning: inapplicable license
prince: http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd:9435: error: XML conditional section not closed
prince: index.html: error: could not load input file
prince: error: no input documents to process

No output file is created. It seems there's a parsing problem with the DTD file. How do I get MathML to work in XHTML?

(The doctype I'm using:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
)
mikeday
Which operating system are you running on, and which Prince package did you install? Do you get the same error if you try and convert a very tiny document that references the DTD like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
<html/>
DanielPharos
I'm running on Mac OS 10.8.4; I downloaded the prince-9.0-macosx.tar.gz tarball from the main Download page and installed it.

No, even with only that in a file, I still get:
prince: /usr/local/lib/prince/license/license.dat: warning: inapplicable license
prince: http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd:9435: error: XML conditional section not closed
prince: Test.html: error: could not load input file
prince: error: no input documents to process
DanielPharos
Okay, I just did a reinstall (thus reverting the change I had to make to the DTD file to get it to work at all), and I am now again getting:

prince: /usr/local/lib/prince/license/license.dat: warning: inapplicable license
prince: http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd:239: error: colon are forbidden from PI names 'IS10744:arch'

I must have mis-deleted that broken tag (lines 239 to 252), because now it's working after deleting those lines! So I have to change my question: why doesn't the DTD file work out-of-the-box? It seems dodgy that I need to modify DTD-files in order to get them to even parse.
DanielPharos
By the way, I deleted this:
<?IS10744:arch xhtml
public-id = "-//W3C//NOTATION AFDR ARCBASE XHTML 1.1//EN"
dtd-public-id = "-//W3C//DTD XHTML 1.1//EN"
dtd-system-id = "xhtml11.dtd"
doc-elem-form = "html"
form-att = "html"
renamer-att = "htnames"
suppressor-att = "htsupp"
data-ignore-att = "htign"
auto = "ArcAuto"
options = "HtModReq HtModOpt"
HtModReq = "Framework Text Hypertext Lists Structure"
HtModOpt = "Standard"
?>


It's the first line (the tag-name with the colon in it) that it's tripping over.
mikeday
Right, I see now. Did you make a change to dtd/catalog.xml as well? Because I'm having trouble figuring out how the DTD is being loaded in the first place, given that the catalog.xml has this:
   <rewriteURI
        uriStartString="http://www.w3.org/Math/DTD/mathml2"
        rewritePrefix="mathml2"/>

    <rewriteURI
        uriStartString="http://www.w3.org/TR/MathML2/dtd"
        rewritePrefix="xhtml-mathml2"/>

And xhtml-math11-f.dtd is located in the second directory, not the first. But that aside, I can reproduce the error, which is in the libxml2 DTD parser. The easiest workaround is for us to remove the IS10744:arch processing instruction from the DTD, while we investigate the libxml2 code and see if we can suggest a patch.
DanielPharos
No, I did not modify the dtd/catalog.xml file, only the DTD file to make the error go away. Deleting those lines looks to be a good workaround until the bug in libxml2 is fixed. Thanks!
David Carlisle
Sorry about that:-)

The XML 1.0 spec was a bit unclear about the status of : in PI names, namespace processing doesn't apply but systems differed on whether they considered : legal or not. This PI just came straight from the XHTML modularisation DTD not from MathML. It is entirely useless (now, given that IS10744 processors are rather thin on the ground)

Unless you are using named character references there presumably is no need to reference DTD at all, and if you are using the DTD to define character references it is best not to use that one. There were several changes after that due to bug fixes, or changes.additions to Unicode. If you use


http://www.w3.org/2003/entities/2007/htmlmathml-f.ent

Then you will use an entity set that matches MathMl3 and HTML(5) and the definitions built in to all current web browsers.