https://bugs.freedesktop.org/show_bug.cgi?id=74941

--- Comment #8 from sm8ps <sm8ps-bugzil...@yahoo.com> ---
(In reply to comment #4)
Thanks for your insight! I am trying to follow your suggestions on the
previously attached file 'LeftLline-RightRline.odt'.

By Flat ODF you mean .fodt (OpenDocument Text (Flat XML) in the Save As
dialogue)? That file opens with the correct formula in LibreOffice. Inspecting
that file I see:

      <math xmlns="http://www.w3.org/1998/Math/MathML";>
       <semantics>
        <mrow>
         <mfenced open="∣" close="∣">
          <mrow>
           <mrow>
            <mi>x</mi>
            <mo stretchy="false">=</mo>
            <mi>y</mi>
           </mrow>
          </mrow>
         </mfenced>
        </mrow>
        <annotation encoding="StarMath 5.0">left lline x=y right
rline</annotation>
       </semantics>
      </math>

  This seems to tell me that the conversion to MathML successfully translates
the vertical bars (<mfenced open="∣" close="∣">).


I checked the source code of xsltml. As far as I can tell, the relevant code
ist at lines 87-142 of 'glayout.xsl'. It *seems* to me that indeed there is are
catch-all clauses that produce round parentheses: lines 98 reads
<xsl:otherwise><xsl:text>\left(</xsl:text></xsl:otherwise>
Similarly line 140 for \right).

Unfortunately I am a bit at loss with XSL (first time I heard of it was today
:). From what I can tell the code *should* correctly translate the .fodt file.
The associated conditions read
    <xsl:when test="@open">
        <xsl:if test="translate(@open,'{}[]()|','{{{{{{{')='{'">

However, at a closer look, I noticed that the vertical bar in the condition
looks different from the one used in the .fodt file. Indeed, here they are side
by side (.fodt, XSL): ∣|
The difference is that the latter is a tiny bit longer that the first one. It
is visible in the gedeit text editor as well as here in the input form in the
browser window. I do not know if it will be visible in the browser output.

This seems to be an encoding issue. I checked the relevant files with a hex
editor and it turns out that ...
. the the XSL file encodes it with a single byte (hex 7c) which is the ASCII
symbol.
. the .fodt file encodes the vertical bar with three bytes (hex e2-88-a3) which
is from the UTF-8 section "mathematical operators".

The way to proceed seems to ...
. either make LibreOffice translate its formula to MathML in a way that xsltml
understands it (i.e. by using ASCII instead of UTF-8 encoding)
. or make xsltml also read the UTF-8 encoded vertical bar.

I have never worked with either (nor with any similar projects). Therefore I
must ask for help in how and where to proceed.

Cheers!
Stefan Mueller, Switzerland

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to