You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Regina Henschel <rb...@t-online.de> on 2014/12/16 16:18:38 UTC

Need help in the code jungle of starmath

Hi all,

I try to use the MathML testsuite 
http://www.w3.org/Math/testsuite/mml2-testsuite/. But those files do not 
open in Math and cannot be imported. I find, that all files fail, which 
do not have the namespace xmlns="http://www.w3.org/1998/Math/MathML" as 
attribute in the root element math. This error remains, if I force the 
type detection to accept those files for the MathML filter.

If the namespace is missing, I get the error "Root element unknown" in 
the parser.

 From a standard view this namespace is not necessary. It is enough to 
have a doctype, and in case of doctype 
http://www.w3.org/Math/DTD/mathml1/mathml.dtd an xmlns attribute is not 
even known.

So, does anyone know
(1) Where is the part, which insists on the xmlns attribute?
(2) Is there a way to deliver this information to the parser, when it is 
missing in the file?

Kind regards
Regina

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


RE: Need help in the code jungle of starmath

Posted by "Dennis E. Hamilton" <de...@acm.org>.
Nice experiments!

 -- reply below to --
From: Regina Henschel [mailto:rb.henschel@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 &Integral; 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>&#x222B;</mo>
     <mi>x</mi>
     <mo>=</mo>
     <mn>1</mn>
   </mrow>
   <mrow>
     <mo>&Integral;</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>&#x222B;</mo>
     <mi>x</mi>
     <mo>=</mo>
     <mn>1</mn>
   </mrow>
   <mrow>
     <mo>&Integral;</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         "&#x0222B;" >
]
 >
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
   <mrow>
     <mo>&#x222B;</mo>
     <mi>x</mi>
     <mo>=</mo>
     <mn>1</mn>
   </mrow>
   <mrow>
     <mo>&Integral;</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-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: Need help in the code jungle of starmath

Posted by Regina Henschel <rb...@t-online.de>.
Hi Dennis,

Dennis E. Hamilton schrieb:
>
>   -- replying below to --
> From: Regina Henschel [mailto:rb.henschel@t-online.de]
> Sent: Sunday, December 28, 2014 09:00
> To: dev@openoffice.apache.org
> Subject: Re: Need help in the code jungle of starmath
>
> Hi Dennis,
>
> Dennis E. Hamilton schrieb:
> [ ... ]
>>
>> <orcnote>
>>       I'm not clear what is the issue about MathML
>>       Names.  If there is a character-set encoding issue, I think that
>>       can be handled in the <?xml> prolog element for free-standing
>>       MathML XML documents.  What non-Unicode are you encountering?
>> </orcnote>
>
> It is not about encoding, but about an entity reference like &int;
> instead of the numeric XML character references &#x222B; or the literal
> character ∫.
>
> <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 &Integral; 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.

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>&#x222B;</mo>
     <mi>x</mi>
     <mo>=</mo>
     <mn>1</mn>
   </mrow>
   <mrow>
     <mo>&Integral;</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>&#x222B;</mo>
     <mi>x</mi>
     <mo>=</mo>
     <mn>1</mn>
   </mrow>
   <mrow>
     <mo>&Integral;</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         "&#x0222B;" >
]
 >
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
   <mrow>
     <mo>&#x222B;</mo>
     <mi>x</mi>
     <mo>=</mo>
     <mn>1</mn>
   </mrow>
   <mrow>
     <mo>&Integral;</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-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


RE: Need help in the code jungle of starmath

Posted by "Dennis E. Hamilton" <de...@acm.org>.
 -- replying below to --
From: Regina Henschel [mailto:rb.henschel@t-online.de] 
Sent: Sunday, December 28, 2014 09:00
To: dev@openoffice.apache.org
Subject: Re: Need help in the code jungle of starmath

Hi Dennis,

Dennis E. Hamilton schrieb:
[ ... ]
>
> <orcnote>
>      I'm not clear what is the issue about MathML
>      Names.  If there is a character-set encoding issue, I think that
>      can be handled in the <?xml> prolog element for free-standing
>      MathML XML documents.  What non-Unicode are you encountering?
> </orcnote>

It is not about encoding, but about an entity reference like &int; 
instead of the numeric XML character references &#x222B; or the literal 
character ∫.

<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>

Since the development of XML seems to go in the direction to waive 
doctypes, I will give this import problem a low priority.

[ ... ]


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: Need help in the code jungle of starmath

Posted by Regina Henschel <rb...@t-online.de>.
Hi Dennis,

Dennis E. Hamilton schrieb:

>      In the ODF 1.2 specification, the use of MathML within ODF
>      documents, or as ODF documents, requires use of the namespace.
>      This is in ODF 1.2 Part 1 section 1.5 Namespaces, Table 4, and
>      section 2.2.1 OpenDocument Document subsection B4.  This applies
>      to MathML 2.0.
> 	  That may also be how import of MathML is expected for StarMath
>      too.  I am speculating.

 From my experiments I conclude, that the sax parser needs the namespace.

>
>>
>> Also, schema validity, not DTD validity, is required.
>
> So I should not care about a DTD and put "resolve MathML Names to
> unicode point on import" on my ToDo list?
>
> <orcnote>
>      I'm not clear what is the issue about MathML
>      Names.  If there is a character-set encoding issue, I think that
>      can be handled in the <?xml> prolog element for free-standing
>      MathML XML documents.  What non-Unicode are you encountering?
> </orcnote>

It is not about encoding, but about an entity reference like &int; 
instead of the numeric XML character references &#x222B; or the literal 
character ∫.

Since the development of XML seems to go in the direction to waive 
doctypes, I will give this import problem a low priority.

I have looked into the export of Word 2010 and the clipboard content 
generated by the MicrosoftMathRecognizer. They produce MathML with 
namespace but without doctype, so there is no interoperability problem.

>
>>
>>
>> THE TEST DOCUMENTS
>>
>> I notice that the usage on the web pages that demonstrate some of the
>> tests, the pages are XHTML and the namespace is used on the <math>
>> elements.
>>
>> In the .mml files themselves, there is no XML prolog at all in the
>> ones I looked at.  There is no DOCTYPE, there is no <?xml> and there
>> are no prefixes.
>
> Yes, that is the problem of the files in testsite.zip. And I'm looking
> what to do to make them readable in AOO.
>
> <orcnote>
>      In the versions embedded in the XHTML web pages of the tests,
>      themselves, the namespace is supplied.
>
>      The .mml basically carries implied recognition of MATHML among
>      parties that recognize the file extension association and do not
>      expect XML Names to be supported.
>
>      This requires out-of-band agreement between interchanging parties
>      and doesn't work for interchange of arbitrary XML Documents.
>
>      I think the easiest way to use the tests is to go through and
>      do a search-replace of <math> to <math xmlns=...> so the tests
>      work where XML is expected.
>
>      Then figuring out how to assume an implied namespace for <math>
>      elements can be explored.
> </orcnote>

I make progress in this aspect. I become aware, that Apache OpenOffice 
imports this special XHTML files from the test suite so, that it only 
imports the MathML fragment and ignores the surrounding XHTML parts.

And I've got assistance from the W3 Math Working Group. They told me, 
that the MathML3 examples have got a namespace in the math-element and 
they point me to 
http://lists.w3.org/Archives/Public/www-math/2012Oct/0013.html, which 
contains the link
http://www.w3.org/Math/testsuite/build/mathml3tests.zip to an offline 
version of the MathML3 testsuite.

So now I have got a lot of suitable, valid test files.

>[..]
> <orcnote>
>     Sorry.  I don't know where to look in the code to deal with this.
>     I think anything produced by AOO should have the namespace handled
>     correctly to ensure ODF 1.2 conformance.  Being more forgiving on
>     input where it is clearly MathML would also be nice.
>
>     I'm no help about where that might be possible in the code.
> </orcnote>

I will focus to get a good import of those .mml files and math 
fragments, which have got a namespace. That will keep me busy for a while.

Kind regards
Regina






---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


RE: Need help in the code jungle of starmath

Posted by "Dennis E. Hamilton" <de...@acm.org>.
  -- Replying to --
From: Regina Henschel [mailto:rb.henschel@t-online.de] 
Sent: Tuesday, December 16, 2014 14:04
To: dev@openoffice.apache.org
Subject: Re: Need help in the code jungle of starmath

Hi Dennis,

Dennis E. Hamilton schrieb:
> For MathML in ODF 1.2 documents, a MathML root element must conform
> to [xml-names] and the root element must have a namespace
> declaration.  Of course an embedded MathML element must also have a
> namespace binding as well.  (This is in the section on Namespaces and
> the one that defines OpenDocument Documents.)

I do not really understand you. Which parts do you refer exactly? Do you 
mean a namespace is required for valid 'MathML 2.0'? Was it required for 
'MathML 1.0'?

<orcnote>
    In the ODF 1.2 specification, the use of MathML within ODF 
    documents, or as ODF documents, requires use of the namespace.  
    This is in ODF 1.2 Part 1 section 1.5 Namespaces, Table 4, and
    section 2.2.1 OpenDocument Document subsection B4.  This applies
    to MathML 2.0.
	  That may also be how import of MathML is expected for StarMath
    too.  I am speculating.
</orcmid>

>
> Also, schema validity, not DTD validity, is required.

So I should not care about a DTD and put "resolve MathML Names to 
unicode point on import" on my ToDo list?

<orcnote>
    I'm not clear what is the issue about MathML
    Names.  If there is a character-set encoding issue, I think that 
    can be handled in the <?xml> prolog element for free-standing
    MathML XML documents.  What non-Unicode are you encountering?
</orcnote>

>
>
> THE TEST DOCUMENTS
>
> I notice that the usage on the web pages that demonstrate some of the
> tests, the pages are XHTML and the namespace is used on the <math>
> elements.
>
> In the .mml files themselves, there is no XML prolog at all in the
> ones I looked at.  There is no DOCTYPE, there is no <?xml> and there
> are no prefixes.

Yes, that is the problem of the files in testsite.zip. And I'm looking 
what to do to make them readable in AOO.

<orcnote>
    In the versions embedded in the XHTML web pages of the tests,
    themselves, the namespace is supplied.

    The .mml basically carries implied recognition of MATHML among
    parties that recognize the file extension association and do not
    expect XML Names to be supported.

    This requires out-of-band agreement between interchanging parties
    and doesn't work for interchange of arbitrary XML Documents.

    I think the easiest way to use the tests is to go through and
    do a search-replace of <math> to <math xmlns=...> so the tests
    work where XML is expected.

    Then figuring out how to assume an implied namespace for <math>
    elements can be explored.
</orcnote>

>
> I think if you add a DOCTYPE, you should still have an
> xmlns="http://www.w3.org/1998/Math/MathML" on the root element.  But
> I think just adding the xmlns declaration should be sufficient for
> the tests to work.

The missing XML prolog is a small problem. That is an if-case in 
smdetect.hxx. For testing I have set the detection on "true" for all 
cases. You come across a missing xml prolog too, when you copy a formula 
from a web page, which uses MathJax. 
http://www.mathjax.org/demos/mathml-samples/

<orcnote>
    Apparently, there should still be a namespace declaration in the 
    <math> element, especially if the default namespace is being used
    With no QNames.

    Although HTML5 does not recognize namespaces and MathML is built-
    in it would have been good for the xmlns=... to be used anyhow with
    MathJax, as described at  
    <http://www.w3.org/TR/MathML3/chapter2.html#interf.namespace>.
    This would work on the clip-board too, always a good idea if the 
    Format is specified to be XML.
</orcmid>

I have tested all combinations of Prolog yes/no - doctype yes/no - 
namespace yes/no. Only the namespace makes the difference whether
AOO is able to understand the files. I thought a general solution would 
come in handy and makes AOO more tolerant in using MathML fragments.

<orcnote>
    It is interesting that MathML says there must always be a <math> 
    element.

    I think for importing there could be tolerance.  I think once
    in an ODF document, the namespace has to be explicit somehow.
</orcnote>

>
> If for some reason, xmlns:math="http://www.w3.org/1998/Math/MathML"
> appears to be required, that is probably because there is an old
> parser being used and it isn't actually doing namespace processing
> correctly.

That is the question. Is there actually a place I can correct the 
missing namespace problem? If it is not possible, I need not look for it.

<orcnote>
   Sorry.  I don't know where to look in the code to deal with this.
   I think anything produced by AOO should have the namespace handled
   correctly to ensure ODF 1.2 conformance.  Being more forgiving on
   input where it is clearly MathML would also be nice.  

   I'm no help about where that might be possible in the code.
</orcnote>

>
> Is this helpful?

Your input is always welcome, especially when I'm going round in circles ;)

Kind regards
Regina

>
> - Dennis
>
>
>
> -----Original Message----- From: Regina Henschel
> [mailto:rb.henschel@t-online.de] Sent: Tuesday, December 16, 2014
> 07:19 To: AOO dev Subject: Need help in the code jungle of starmath
>
> Hi all,
>
> I try to use the MathML testsuite
> http://www.w3.org/Math/testsuite/mml2-testsuite/. But those files do
> not open in Math and cannot be imported. I find, that all files fail,
> which do not have the namespace
> xmlns="http://www.w3.org/1998/Math/MathML" as attribute in the root
> element math. This error remains, if I force the type detection to
> accept those files for the MathML filter.
>
> If the namespace is missing, I get the error "Root element unknown"
> in the parser.
>
> From a standard view this namespace is not necessary. It is enough
> to have a doctype, and in case of doctype
> http://www.w3.org/Math/DTD/mathml1/mathml.dtd an xmlns attribute is
> not even known.
>
> So, does anyone know (1) Where is the part, which insists on the
> xmlns attribute? (2) Is there a way to deliver this information to
> the parser, when it is missing in the file?
>
> Kind regards Regina

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: Need help in the code jungle of starmath

Posted by Regina Henschel <rb...@t-online.de>.
Hi Dennis,

Dennis E. Hamilton schrieb:
> For MathML in ODF 1.2 documents, a MathML root element must conform
> to [xml-names] and the root element must have a namespace
> declaration.  Of course an embedded MathML element must also have a
> namespace binding as well.  (This is in the section on Namespaces and
> the one that defines OpenDocument Documents.)

I do not really understand you. Which parts do you refer exactly? Do you 
mean a namespace is required for valid 'MathML 2.0'? Was it required for 
'MathML 1.0'?

>
> Also, schema validity, not DTD validity, is required.

So I should not care about a DTD and put "resolve MathML Names to 
unicode point on import" on my ToDo list?

>
>
> THE TEST DOCUMENTS
>
> I notice that the usage on the web pages that demonstrate some of the
> tests, the pages are XHTML and the namespace is used on the <math>
> elements.
>
> In the .mml files themselves, there is no XML prolog at all in the
> ones I looked at.  There is no DOCTYPE, there is no <?xml> and there
> are no prefixes.

Yes, that is the problem of the files in testsite.zip. And I'm looking 
what to do to make them readable in AOO.

>
> I think if you add a DOCTYPE, you should still have an
> xmlns="http://www.w3.org/1998/Math/MathML" on the root element.  But
> I think just adding the xmlns declaration should be sufficient for
> the tests to work.

The missing XML prolog is a small problem. That is an if-case in 
smdetect.hxx. For testing I have set the detection on "true" for all 
cases. You come across a missing xml prolog too, when you copy a formula 
from a web page, which uses MathJax. 
http://www.mathjax.org/demos/mathml-samples/

I have tested all combinations of Prolog yes/no - doctype yes/no - 
namespace yes/no. Only the namespace makes the difference whether
AOO is able to understand the files. I thought a general solution would 
come in handy and makes AOO more tolerant in using MathML fragments.

>
> If for some reason, xmlns:math="http://www.w3.org/1998/Math/MathML"
> appears to be required, that is probably because there is an old
> parser being used and it isn't actually doing namespace processing
> correctly.

That is the question. Is there actually a place I can correct the 
missing namespace problem? If it is not possible, I need not look for it.

>
> Is this helpful?

Your input is always welcome, especially when I'm going round in circles ;)

Kind regards
Regina

>
> - Dennis
>
>
>
> -----Original Message----- From: Regina Henschel
> [mailto:rb.henschel@t-online.de] Sent: Tuesday, December 16, 2014
> 07:19 To: AOO dev Subject: Need help in the code jungle of starmath
>
> Hi all,
>
> I try to use the MathML testsuite
> http://www.w3.org/Math/testsuite/mml2-testsuite/. But those files do
> not open in Math and cannot be imported. I find, that all files fail,
> which do not have the namespace
> xmlns="http://www.w3.org/1998/Math/MathML" as attribute in the root
> element math. This error remains, if I force the type detection to
> accept those files for the MathML filter.
>
> If the namespace is missing, I get the error "Root element unknown"
> in the parser.
>
> From a standard view this namespace is not necessary. It is enough
> to have a doctype, and in case of doctype
> http://www.w3.org/Math/DTD/mathml1/mathml.dtd an xmlns attribute is
> not even known.
>
> So, does anyone know (1) Where is the part, which insists on the
> xmlns attribute? (2) Is there a way to deliver this information to
> the parser, when it is missing in the file?
>
> Kind regards Regina

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


RE: Need help in the code jungle of starmath

Posted by "Dennis E. Hamilton" <de...@acm.org>.
For MathML in ODF 1.2 documents, a MathML root element must conform to [xml-names] and the root element must have a namespace declaration.  Of course an embedded MathML element must also have a namespace binding as well.  (This is in the section on Namespaces and the one that defines OpenDocument Documents.)

Also, schema validity, not DTD validity, is required.  


THE TEST DOCUMENTS

I notice that the usage on the web pages that demonstrate some of the tests, the pages are XHTML and the namespace is used on the <math> elements.

In the .mml files themselves, there is no XML prolog at all in the ones I looked at.  There is no DOCTYPE, there is no <?xml> and there are no prefixes.

I think if you add a DOCTYPE, you should still have an xmlns="http://www.w3.org/1998/Math/MathML" on the root element.  But I think just adding the xmlns declaration should be sufficient for the tests to work.

If for some reason, xmlns:math="http://www.w3.org/1998/Math/MathML" appears to be required, that is probably because there is an old parser being used and it isn't actually doing namespace processing correctly.

Is this helpful?

 - Dennis



-----Original Message-----
From: Regina Henschel [mailto:rb.henschel@t-online.de] 
Sent: Tuesday, December 16, 2014 07:19
To: AOO dev
Subject: Need help in the code jungle of starmath

Hi all,

I try to use the MathML testsuite 
http://www.w3.org/Math/testsuite/mml2-testsuite/. But those files do not 
open in Math and cannot be imported. I find, that all files fail, which 
do not have the namespace xmlns="http://www.w3.org/1998/Math/MathML" as 
attribute in the root element math. This error remains, if I force the 
type detection to accept those files for the MathML filter.

If the namespace is missing, I get the error "Root element unknown" in 
the parser.

 From a standard view this namespace is not necessary. It is enough to 
have a doctype, and in case of doctype 
http://www.w3.org/Math/DTD/mathml1/mathml.dtd an xmlns attribute is not 
even known.

So, does anyone know
(1) Where is the part, which insists on the xmlns attribute?
(2) Is there a way to deliver this information to the parser, when it is 
missing in the file?

Kind regards
Regina

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org