DocBook to Word Conversion?

社会主义新天地 提交于 2019-12-21 04:08:12

问题


I need some help with conversion of DocBook files to Microsoft Word files.

Do I need an XSL file for the transformation?


回答1:


Yes, you do need an XSL file. You can get XSL files for DocBook from the free DocBook XML distribution. Then, you run a free XSLT transformer such as Saxon. If you run Saxon from a command line, you give it the name of your DocBook file, and the name of one of the stylesheets, and it will transform your file according to the rules in the stylesheet.

What you need to do to transform to Word, is to pick the right stylesheet.

From DocBook XSL: The Complete Guide, here are three possibilities:

  • Convert to XSL-FO and then use the XMLmind to export to Word. See the XMLmind website for more information.
  • Use a limited set of tags and then use one of DocBook XML's included stylesheets to output to WordML.
  • Try to use Jfor to output to RTF, although Jfor no longer appears to be maintained.

And I have one of my own:

  • As above, use one of DocBook XML's included stylesheets to publish to XSL-FO, then run Apache FOP to convert from XSL-FO to RTF. You will lose the structural information, but you will keep a certain amount of the formatting.



回答2:


I recently implemented same feature for our users. They use Oxygen XML editor that allows for easy transformations via XSL. I was going to do OOXML but settled on WordML. As a starting point I used roundtrip XSL, but I had to rewrite lots of templates because of existing bugs or just missing functionality. In addition, I did other customization to serve a purpose or for our XML file only.

I would not mind contributing back to the project, but don't really know how to get about it.




回答3:


I am using XQuery to transform DocBook into various formats using XQuery typeswitch library. XQuery uses indexes so I can transform many documents very quickly.



来源:https://stackoverflow.com/questions/6294495/docbook-to-word-conversion

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!