有谁知道一个能够从Microsoft Office Open XML文件生成XSL-FO的库,例如Word DOCX或Excel XLSX?
鉴于这些Office文件基本上是ZIP文件中的XML,我认为通过应用适当的XSLT转换从它们生成XSL-FO非常简单 - 尽管编写XSLT需要一些时间。 但是,如果我怀疑这是一个简单的话,那么也许有人编写了一个可以执行此操作的库,或者发布了执行此操作的XSLT转换。
此Microsoft MSDN库文章包含使用Word 2003 WordprocessingML文件创建XSL-FO的示例,但我还没有看到任何更新的Open XML格式。
有没有人有建议? Java库是更可取的,但任何事情都会被考虑。
Does anyone know of a library that is capable of generating XSL-FO from a Microsoft Office Open XML file, such as a Word DOCX or an Excel XLSX?
Given that these Office files are basically XML in a ZIP file, I figure it would be pretty straightforward to generate XSL-FO from them by applying appropriate XSLT transformations — though writing the XSLT would take some time. But if it is a straightforward as I suspect, then maybe someone has written a library that does it, or released XSLT transformations that do it.
This Microsoft MSDN library article contains an example of creating XSL-FO with Word 2003 WordprocessingML files, but I haven't seen anything for the newer Open XML format.
Does anyone have suggestions? A Java library would be preferable, but anything would be considered.
最满意答案
对于docx, docx4j对此有所支持; 从v3.3.0开始它就在一个单独的项目中https://github.com/plutext/docx4j-export-FO
它使用XSLT创建XSL-FO。 XSLT使用Java扩展函数调用docx4j方法来完成大部分工作,使XSLT本身保持相对简单。
docx4j使用FOP将XSL FO转换为PDF。
docx4j支持xlsx,但没有从XLSX到XSL FO的内置导出。
docx4j has support for this, for docx; since v3.3.0 it is in a separate project https://github.com/plutext/docx4j-export-FO
It uses XSLT to create the XSL-FO. The XSLT uses Java extension functions to invoke docx4j methods to do much of the work, keeping the XSLT itself relatively simple.
docx4j uses FOP to convert XSL FO to PDF.
docx4j has support for xlsx, but no built in export from XLSX to XSL FO.
更多推荐
XSL-FO,XML,XSLT,电脑培训,计算机培训,IT培训"/> <meta name="description&q
发布评论