xsl:fo检索标记无效的子代 [英] xsl:fo retrieve-marker not valid child
本文介绍了xsl:fo检索标记无效的子代的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将xsl:fo转换为表中的<fo:retrieve-marker>
,但我不知道是否可行,因为我使用FOP处理器进行转换.
I need for my xsl:fo transformation an <fo:retrieve-marker>
in an table but I don't know if this is possible because I use FOP Processor for my transformation.
如果我在表中使用<fo:retrieve-marker>
,则总是会收到一条错误消息,提示代码必须包含静态内容.
If i use the <fo:retrieve-marker>
in my table I always get an error message that the tag has to be in an static content.
这是带有标记的表
<xsl:call-template name="MMEL-Table-Header"/>
<!-- Bottom table Line -->
<fo:table-footer>
<fo:table-row>
<fo:table-cell>
<fo:marker marker-class-name="footer-continued"> <fo:inline>(continued)</fo:inline></fo:marker>
</fo:table-cell>
</fo:table-row>
</fo:table-footer>
<fo:table-body >
<xsl:variable name="identification">
<xsl:value-of select="ident/message"/>
</xsl:variable>
<xsl:apply-templates select="ident"><xsl:with-param name="ident" select="$identification"/></xsl:apply-templates>
<xsl:apply-templates select="provisos/proviso"><xsl:with-param name="ident" select="$identification"/></xsl:apply-templates>
<fo:table-row>
<fo:table-cell> <fo:retrieve-marker retrieve-position="first-starting-within-page" retrieve-class-name="footer-continued" retrieve-boundary="document" /> </fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
推荐答案
(披露:我是FOP开发人员)
此示例具有动态表头和表尾,因此应满足您的要求:
This example has dynamic table header and table footer, so it should cover your requirements:
- 如果表格适合单个页面,则表格标题和表格页脚均为空
- 如果表格分为几页
- 第一页面的表标题为空,在随后的页面标题中为(续)"
- 最后页面的表脚为空,而在前一个页面的表脚中显示为(下一页继续)"
- if the table fits in a single page, both table header and table footer are empty
- if the table is split over several pages
- the table header is empty for the first page, and in the following ones it says "(continued)"
- the table footer is empty for the last page, and in the previous ones it says "(continues on the next page)"
FO片段:
<fo:table table-layout="fixed" width="100%"> <fo:table-column column-width="100%"/> <fo:table-header> <fo:table-row> <fo:table-cell> <fo:block> <fo:retrieve-table-marker retrieve-class-name="mc1" retrieve-position-within-table="first-starting" retrieve-boundary-within-table="table-fragment"/>   </fo:block> </fo:table-cell> </fo:table-row> </fo:table-header> <fo:table-footer> <fo:table-row> <fo:table-cell> <fo:block> <fo:retrieve-table-marker retrieve-class-name="mc2" retrieve-position-within-table="last-ending" retrieve-boundary-within-table="table-fragment"/>   </fo:block> </fo:table-cell> </fo:table-row> </fo:table-footer> <fo:table-body> <!-- first row --> <fo:table-row> <fo:table-cell> <fo:block> <fo:marker marker-class-name="mc1"></fo:marker> <fo:marker marker-class-name="mc2">(continues on the next page)</fo:marker> cell1 </fo:block> </fo:table-cell> </fo:table-row> <!-- middle row --> <fo:table-row> <fo:table-cell> <fo:block> <fo:marker marker-class-name="mc1">(continued)</fo:marker> <fo:marker marker-class-name="mc2">(continues on the next page)</fo:marker> cell2 </fo:block> </fo:table-cell> </fo:table-row> <!-- ... other similar rows ... --> <!-- last row --> <fo:table-row> <fo:table-cell> <fo:block> <fo:marker marker-class-name="mc1">(continued)</fo:marker> <fo:marker marker-class-name="mc2"></fo:marker> cell9 </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table>
这篇关于xsl:fo检索标记无效的子代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文