I'm using an XSLT 2.0 program to process some MathML documents. In those MathMLs, there are entities like ⁡
and ⁢
, that give me "entity not defined" errors. Is there a way I can process documents with these entities without loading the MathML schema? (Because Saxon-HE cannot use xsl:import-schema
…)
And just to be clear, I don't need to use the entities in my XSLT; I need to process XMLs that have them.
There's an entity file for MathML like this:
<!ENTITY AElig "Æ" ><!--LATIN CAPITAL LETTER AE -->
<!ENTITY AMP "&#38;" ><!--AMPERSAND -->
<!ENTITY Aacute "Á" ><!--LATIN CAPITAL LETTER A WITH ACUTE —>
...
Maybe I can somehow make use of that?
UPDATE: multiple people has mentioned that the input documents should have the correct DTD. So here's an minimal example:
The XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:m="http://www.w3.org/1998/Math/MathML">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:text>aaa</xsl:text>
</xsl:template>
</xsl:stylesheet>
The MathML with DTD declaration:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN"
"http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mi> sin </mi>
<mo> ⁡ </mo>
<mi> x </mi>
</mrow>
</math>
Now Saxon gives me this error:
I/O error reported by XML parser processing file:/path/to/mathml.xml: unknown protocol: classpath