Re: Entity References
Werner Hager wrote: > I've just recently joined and it looks like there is a lot of useful > information going around. Maybe I can get some ideas about my particular > problem. I'm writing an XSLT to transform one MathML Document to another > MathML Document with the addition of some formatting tags so it prints > better on a braille printer. The issue is the special entities that are > used in MathML. Since a MathML document doesn't need to declare their > entities, I think my processor is having problems with them. Here is the > sample MathML Document: > > <mrow> > <snipped/> > </mrow> > > I'm using Xalan-Java for testing puposes, but I want it to work with MSXSL > as well (I want most of the process to be invisible to the user) With > Xalan, I get the error [the entity "InvisibleTimes" was referenced but not > declared]. MathML has a large number of these entities... Any ideas how > I can copy them into the result tree? You don't appear to be including a reference to the MathML DTD in your XML document. I presume you have downloaded the DTD from http://www.w3.org/Math/DTD/ If you add a DOCTYPE declaration, then the XML parser should be able to resolve the entities correctly. The following works ok on my system:- <!DOCTYPE mrow SYSTEM "file:///c:/xml/MathML/dtd/mathml2.dtd"> <mrow> <mfenced> <mrow> <mi>x</mi> <mo>+</mo> <mn>2</mn> </mrow> </mfenced> <mo>⁢</mo> <mfenced> <mrow> <mi>x</mi> <mo>-</mo> <mn>3</mn> </mrow> </mfenced> </mrow> Regards ~Rob -- Rob Lugt ElCel Technology http://www.elcel.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format