【问题标题】:xdmp:word-convert() with DOCX in MarkLogicxdmp:word-convert() 与 MarkLogic 中的 DOCX
【发布时间】:2018-10-27 17:29:03
【问题描述】:

我正在尝试使用 xdmp:word-convert() 函数转换我的二进制文档(DOCX 文件),这会引发以下错误。

您尝试转换的文件格式不正确。 DHF-INVFILE: xdmp:word-convert(fn:doc("/content/aplc/binary/13599668870066633077.docx"), "13599668870066633077.docx", true...) -- 您尝试转换的文件格式不正确。输入=/var/opt/MarkLogic/Temp/0b71d7278e82c553/toconv.doc

我的代码如下

xdmp:word-convert(
     $xml-input,
     fn:concat(xdmp:hash64("Sample.docx"),".docx"),
     <options xmlns="xdmp:word-convert" xmlns:tidy="xdmp:tidy">
          <tidy>true</tidy>
          <tidy:clean>yes</tidy:clean>
          <tidy:drop-empty-paras>yes</tidy:drop-empty-paras>
          <tidy:drop-font-tags>yes</tidy:drop-font-tags>
          <tidy:hide-comments>yes</tidy:hide-comments>
          <tidy:output-html>no</tidy:output-html>
          <tidy:output-xhtml>no</tidy:output-xhtml>
          <tidy:output-xml>yes</tidy:output-xml>
          <compact>true</compact>
      </options>)

相同的代码与 .doc 扩展一起工作得很好

如果 xdmp:word-convert() 不适用于 DOCX 文件,除了 xdmp:document-filter 之外,还有哪些其他可能的 API 函数可以做类似的工作。

【问题讨论】:

    标签: xquery marklogic marklogic-9


    【解决方案1】:

    xdmp:word-convert 上的文档说:

    不转换 Microsoft Office 2007 及更高版本的文档。

    对于更新的 office 文档,您可以查看将 CPF 与 Office OpenXML Extract 管道一起使用,此处也提到:https://stackoverflow.com/a/11248525/918496

    HTH!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-29
      • 1970-01-01
      • 1970-01-01
      • 2016-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-16
      相关资源
      最近更新 更多