Nice experiments! -- reply below to -- From: Regina Henschel [mailto:rb.hensc...@t-online.de] Sent: Sunday, December 28, 2014 11:46 To: dev@openoffice.apache.org Subject: Re: Need help in the code jungle of starmath
Hi Dennis, Dennis E. Hamilton schrieb: [ ... ] > <orcmid> > Ah! Character entities. Yes that is a problem. > Hmm, perhaps a standalone internal DTD could be used to define these. > I am not certain how one gets around DTD validation. > > It would be nice > to use the character entities rather than the character references. > I would avoid the literal characters of course, because their being > understandable depends on font availability. > > Does the MathML DTD provide definitions that could be moved to an > internal DTD? > > Perhaps a brief experiment to see if that much will be accepted by > the SAX parser? > </orcmid> Some brief experiments: When I use version A or B (see below) the reference ∫ is not resolved. The browser Seamonkey resolves it in both cases, so I assume that the syntax and URI is correct. The version C is resolved correctly by Apache OpenOffice, Seamonkey and Word 2010 but not by LibreOffice; which shows, that the error is likely inside LibreOffice. The mappings are in a file "mmlalias.ent" but I don't know, how I can link to it in the doctype declaration. I see no problem in using a literal character, because such character itself has no binding to a font. When you try version C, you will notice, that the integral sign is the same in all three occurrences. <orcmid> Some observations. 1. I don't think what browsers do is reliable because they may have implementation-supported built-in character entities as a feature unrelated to any standard (e.g., for XHTML or whatever). 2. I looked through the MathML DTD and it doesn't define any character entities at all. It uses the literals for the Copyright symbol and curved quotes in its commentary! 3. I think you can include the mmlalias.ent file via parameter reference in the internal DTD. But this may be blocked for security reasons in some implementations. And it has to be somewhere in a resource or the install directory where code can find it. Seems too brittle. 5. The reason I prefer character entities is that people may not know what the intended character is. Likewise, using the character code directly in the UTF-8 does require that the file be viewed in a tool that has a proper character set. There are great differences in rendering even when the codes are recognized. 6. Just the same, since LibreOffice does not appear to process the internal DTD, I think you need to use the character codes so long as they are not in any special area of Unicode. I'm disappointed but interoperability seems more important. Kind regards Regina == A ====================================================== <?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> <mrow> <mo>∫</mo> <mi>x</mi> <mo>=</mo> <mn>1</mn> </mrow> <mrow> <mo>∫</mo> <mi>x</mi> <mo>=</mo> <mn>2</mn> </mrow> <mrow> <mo>∫</mo> <mi>x</mi> <mo>=</mo> <mn>3</mn> </mrow> </mrow> </math> == B =================================== <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "../../w3org/Doctypes/mathml2/mathml2/mathml2.dtd" > <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mrow> <mo>∫</mo> <mi>x</mi> <mo>=</mo> <mn>1</mn> </mrow> <mrow> <mo>∫</mo> <mi>x</mi> <mo>=</mo> <mn>2</mn> </mrow> <mrow> <mo>∫</mo> <mi>x</mi> <mo>=</mo> <mn>3</mn> </mrow> </mrow> </math> == C =========================================== <?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" [ <!ENTITY Integral "∫" > ] > <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mrow> <mo>∫</mo> <mi>x</mi> <mo>=</mo> <mn>1</mn> </mrow> <mrow> <mo>∫</mo> <mi>x</mi> <mo>=</mo> <mn>2</mn> </mrow> <mrow> <mo>∫</mo> <mi>x</mi> <mo>=</mo> <mn>3</mn> </mrow> </mrow> </math> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org For additional commands, e-mail: dev-h...@openoffice.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org For additional commands, e-mail: dev-h...@openoffice.apache.org