简体   繁体   English

是否可以使用XSL-FO对物理(PDF)页面上的标签进行计数?

[英]Is there a way to count tags on a physical (PDF) page using XSL-FO?

Here is the scenario. 这是场景。 I have an XML document which contains tags. 我有一个包含标签的XML文档。 I want to create a transform that does this 我想创建一个执行此操作的转换

<tag>content A</tag>           1. content A
<tag>content B</tag>  ---->    2. content B
<tag>content C</tag>           3. content C

but only if the tag contents appear on the same physical page. 但前提是标签内容显示在同一物理页面上。 The numbering should restart on each new page. 编号应在每个新页面上重新开始。 Is there any way to do this using XSL-FO? 有什么办法可以使用XSL-FO做到这一点? I know with latex the only way to accomplish something like this is to run latex twice, with the interim document used to determine content page placement. 我知道使用乳胶完成此操作的唯一方法是运行两次乳胶,并使用临时文档确定内容页面的位置。

As far as I can tell (and as confirmed by the Antenna House tech support team), there is no way to do this using standard XSL-FO . 据我所知(并得到Antenna House技术支持团队的确认), 无法使用标准XSL-FO来执行此操作 Antenna House offers <axf:footnote*/> extensions which include the ability to set an axf:footnote-number-reset="page" attribute, and as suggested in the comments, RenderX offers a generic mechanism which might be used for this purpose, but both of these involve vendor-specific extensions to the language. Antenna House提供了<axf:footnote * />扩展,其中包括设置axf:footnote-number-reset =“ page”属性的功能,并且正如注释中所建议的那样,RenderX提供了可用于此目的的通用机制。 ,但这两个都涉及该语言的特定于供应商的扩展。

This points to a number of shortcomings in XSL-FO that really should have been addressed a long time ago with a 2.0 version of the specification. 这指出了XSL-FO中的许多缺陷,而这些缺陷早在很久以前就已经通过规范的2.0版本解决了。 A w3c committee to develop an XSL-FO 2.0 spec was formed and then disbanded quite some time ago; 成立了一个开发XSL-FO 2.0规范的w3c委员会,然后在相当一段时间前将其解散。 I have no idea why, as I find the tool indispensable for a large class of document to PDF conversions. 我不知道为什么,因为我发现大量文档到PDF转换所必需的工具。

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

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