XML, xmlproc, MathML and validation

Will Stuyvesant hwlgw at hotmail.com
Fri Jul 11 09:33:22 EDT 2003


I am trying to validate a document with mixed XHTML and MathML.

The doctype declaration is:
<!DOCTYPE html PUBLIC
        "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
        "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"> 

And the w3c validator at http://validator.w3.org/ says my XML file is
valid.
So far so good.

But now I want to use xmlproc to both validate it and change something
in it.  I use "from xml.parsers.xmlproc import xmlval".
This works good when the DTD is local but does not work in this case,
where the DTD is remote.  I can't have the MathML DTD local (it is now
available as one file cause they made some stupid decision when
designing it).

The error message:

ERROR: xml:space must have exactly the values 'default' and 'preserve'
at http:/
/www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd:2025:1

=============================================================

My original problem:

I am trying to write a valid2browser.py that replaces all occurences
of

<!DOCTYPE html PUBLIC
        "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
        "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"> 

by

<?xml-stylesheet type="text/xsl" href="mathml.xsl"?>

so my browser can display it.  And before that validate it if
possible.
And then I want a browser2valid.py program.

Fun projects!




More information about the Python-list mailing list