-- Replying to --
From: Regina Henschel [mailto:rb.hensc...@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.hensc...@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-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

Reply via email to