简体   繁体   English

使用Java从XSL-FO生成HTML

[英]generating HTML from XSL-FO using Java

I have some PDF files generated based on some XSL-FO documents and I now need this content in HTML too. 我有一些基于一些XSL-FO文档生成的PDF文件,我现在也需要这个HTML内容。 I am using FOP for creating the PDF files but this does not support HTML as an output format. 我使用FOP创建PDF文件,但这不支持HTML作为输出格式。

My question is this: Is there a Java library of some sort that can create HTML files based on XSL-FO documents, or can I do this with throwing XSLT at it. 我的问题是:是否有某种类型的Java库可以基于XSL-FO文档创建HTML文件,或者我可以通过抛出XSLT来实现这一点。 Can I somehow extend FOP to create me this type of output? 我可以以某种方式扩展FOP来创建这种类型的输出吗?

If XSLT is the only way to go, is there one already created? 如果XSLT是唯一的方法,那么是否已经创建了一个? (I imagine I am not the first dude wanting this) (我想我不是第一个想要这个的家伙)

Thank you all! 谢谢你们!

You could use the Render-X provided FO2HTML stylesheet to convert the XSL-FO into XHTML output. 您可以使用Render-X提供的FO2HTML样式表XSL-FO转换为XHTML输出。 It converts <block> elements into <div> , <inline> into <span> , etc. 它将<block>元素转换为<div><inline>转换为<span>等。

I have used it, and it works great. 我用过它,效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM