使用 XSL-FO 和 HTML?

问题描述:

我正在尝试使用 XSLT 将一些 XML 数据转换为 HTML 以供我的学士论文使用.

I'm trying to transform some XML-data to HTML with XSLT for my bachelor thesis.

我的教授希望我也考虑 XSL-FO,或者至少写一些关于它的文字.但我对此非常菜鸟.

My professor wants me to consider XSL-FO too, or at least to write some word about it. But I'm very noob to this.

所以我的问题是:

我可以将 FO 与 HTML 结合使用吗?我可以使用 FO 代替 HTML 和 CSS 吗?如果是,我的浏览器将如何呈现?是否有关于如何使用 FO 将 xml 转换为网页的示例/教程?

Can I combine FO with HTML? Can I use FO istead of HTML and CSS? If yes, how will my browser render this? Are there any examples/tutorials on how to transform xml into web pages with FO?

XSL-FO 仅用于 PDF 显示(严格来说这不正确,但您可以将其作为指南).所以 HTML 输出和 FO 输出没有关系.从您的 XML 源代码中,您可以使用 XSLT 生成 XHTML XSL-FO,但不能同时生成.

XSL-FO is for PDF display only (this is not strictly true, but you can take it as a guideline). So HTML output and FO output are not related. From your XML source, you can use XSLT to generate XHTML or XSL-FO, but not both at the same time.

例如参见 DocBook.它带有几个随时可用的 XSLT 样式表,一个用于 HTML 输出,另一个用于 PDF(通过 Apache Fop).如果您对结果感到满意可能是另一个问题.

See for example DocBook. It comes with several XSLT stylesheets ready to use, one is for HTML output and one for PDF (via Apache Fop). If you are satisfied with the result could be a different question.