so I am working on a JAVA/html/php project.
I am reading the OOXML out of a docx and saving all that into a String, cause in that String I can search for the "relevant" tags with the help of regex. After that I save that tags in a MYSQL database. And after that I want to display the data out of the database on a html/php webside.
For example: I found the OOXML tags, that represent "Hello sqrt(2)" while sqrt(2) is "squareroot of 2" (just in symbols) and safed that as a String into my database.
<w:t>Hello</w:t><w:t xml:space="preserve"> </w:t><m:oMath><m:rad><m:radPr><m:degHide m:val="1"/><m:ctrlPr><w:rPr><w:rFonts w:ascii="Cambria Math" w:eastAsiaTheme="minorEastAsia" w:hAnsi="Cambria Math"/><w:i/></w:rPr></m:ctrlPr></m:radPr><m:deg/><m:e><m:r><w:rPr><w:rFonts w:ascii="Cambria Math" w:eastAsiaTheme="minorEastAsia" w:hAnsi="Cambria Math"/></w:rPr><m:t>2</m:t></m:r></m:e></m:rad></m:oMath>
My problem now is, that in my browser the "squareroot of 2 symbol" is not displayed, when I am printing that String out of my database, cause browsers like Chrome do not support OMML (the <m:oMath> tags). So my question now is, if there is a possibility to display that? I found some similar questions and they suggest to transform the OMML math tags into MathML, which is supported by html. (well, I figured out, Chrome is not supporting MathML right now, but there is a script, that helps out called MathJax...)
So a solution could be transforming the whole omml tags into MathML. But how can I do that? There is a solution here: Reading equations from Word (*.docx) to HTML together with their text context using apache poi
But that seems very complicated to me, cause its working with the word file. I allready have the xml as a String.
So if you have an idea, how I could solve that problem or if you have new ideas, I would be very very thankfull to you. Perhaps I am thinking to complicated and there is an easy way of showing OMML math formulas in html, which I don't know.
Thanks a lot!
If someone will have the same issue in the future:
In the end, I did it like recommended in
Reading equations from Word (*.docx) to HTML together with their text context using apache poi
I transfered the whole docx document to html and MathML. And after that I looked for my relevant tags with regex again.