【问题标题】:Reading equations & formula from Word (Docx)从 Word (Docx) 中读取方程式和公式
【发布时间】:2014-09-07 11:40:55
【问题描述】:

我们有一个包含方程式的 word/docx 文件。使用 POI 的 XWPFWordExtractor.getText 不会读取方程式。

我的问题是:

  1. 这些方程是什么/如何表示的?
  2. 如何阅读它们(我希望最终将它们显示在 HTML 上 - 作为 MathML??)?

谢谢!

【问题讨论】:

    标签: java ms-word apache-poi docx mathml


    【解决方案1】:

    docx 文件中的方程式是使用 omml m:oMathPara/m:oMath 表示的:

      <m:oMathPara xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">
        <m:oMath>
    

    我不了解 POI,但在 docx4j 中,该命名空间中的元素使用 org.docx4j.math 中的 JAXB 生成的对象表示

    我将通过编组 m:oMathPara/m:oMath 来解决您的第二个问题,然后通过 omml2mathml.xsl 进行转换,请参阅 Murray Sargent 的博客(例如 herehere)。

    【讨论】:

    • 感谢您的指导。将检查 docx4j。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-23
    相关资源
    最近更新 更多