XSL-FO:如何为每一页重复一个 xsl 表? [英] XSL-FO : How do I repeat an xsl table for every page?

查看:22
本文介绍了XSL-FO:如何为每一页重复一个 xsl 表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前通过在 xsl-fo 的 region-before AKA 标题部分中包含表来完成它.但是,这引入了一个问题,需要动态设置region-body的margin-top,因为table的高度不固定.

I've done it previously by including the table in region-before AKA header section of xsl-fo. However, this introduces a problem of needing to dynamically set the margin-top of the region-body because the table's height is not fixed.

因此,我需要将它包含在 region-body 中.我发现了有关此的问题,但它们仅涉及如何重复表的标题.就我而言,我需要在每一页中重复整个表格.是否可以?如果是这样,我该怎么做?

Hence, I would need to include it in region-body. I've found questions on this but they are only on how to repeat headers of a table. In my case, I need to repeat the whole table in each page. Is it possible? If so, how do I do that?

编辑顺便说一句,我在 Xalan 中使用 FOP

EDIT Btw, I'm using FOP with Xalan

推荐答案

如果您将 Antenna House 或 FOP 与 Saxon 9.5、Xalan 或 DotNet 4.0 XSLT 处理器一起使用,那么您可以使用 Print andPage Layout Community Group @ W3C 在您的 XSLT 转换中间运行 FO 处理器.请参阅 http://www.w3.org/community/ppl/wiki/XSLTExtensions 中的示例

If you are using either Antenna House or FOP with either Saxon 9.5, Xalan, or DotNet 4.0 XSLT processors, then you can use the XSLT extensions from the Print and Page Layout Community Group @ W3C to run the FO processor in the middle of your XSLT transform. See the examples at http://www.w3.org/community/ppl/wiki/XSLTExtensions

您可以制作一个仅用于渲染表格的最小 FO 文档,然后在其上运行扩展函数以获得包含格式化表格的区域树.最后,您将根据格式化表格的高度调整 fo:region-body 的边距.

You can make a minimal FO document for rendering just the table, then run the extension functions on that to get an area tree containing the formatted table. Lastly, you'd then adjust the margins for the fo:region-body based on the height of the formatted table.

如果您没有可以运行扩展功能的 XSLT 处理器,但有可以生成区域树输出的 FO 处理器,您可以运行一次 FO 处理器以获取表的区域树,然后运行它真实的并让 XSLT 转换使用先前生成的区域树 XML 来计算 fo:region-body 的表格高度和边距.

If you don't have an XSLT processor that can run the extension functions but do have an FO processor that can produce area tree output, you could run the FO processor once to get the area tree for the table, then run it for real and have the XSLT transform use the previously generated area tree XML to work out the table height and the margins for fo:region-body.

这篇关于XSL-FO:如何为每一页重复一个 xsl 表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆