Xslt 如何使用XSL-FO确定页面是否溢出到其他页面?
我有一个Xslt 如何使用XSL-FO确定页面是否溢出到其他页面?,xslt,xsl-fo,apache-fop,Xslt,Xsl Fo,Apache Fop,我有一个xsl:for-each,它递归地添加fo:table元素。在xsl之前:对于每个我都有一个“标题”块 我想知道的是,我是否可以确定表是否溢出到另一个页面,并允许我再次“注入”标题栏。通过这种方式,我可以指示上一个表已继续 -> Page 1 --> The Title ---> Table -> Page 2 --> The Title (cont.) ---> Remaining Table 更新 采纳的建议并尝试使用fo:table heade
xsl:for-each
,它递归地添加fo:table
元素。在xsl之前:对于每个我都有一个“标题”块
我想知道的是,我是否可以确定表是否溢出到另一个页面,并允许我再次“注入”标题栏。通过这种方式,我可以指示上一个表已继续
-> Page 1
--> The Title
---> Table
-> Page 2
--> The Title (cont.)
---> Remaining Table
更新
采纳的建议并尝试使用fo:table header
fop2.1支持fo:retrieve table标记,该标记应允许使用“continued”header。然而,续集似乎不起作用,加上现在正文与页眉重叠
<xsl:for-each select="results/group">
<fo:block>
<fo:table table-layout="fixed" width="100%">
<fo:table-column column-width="1.8in"/>
<fo:table-column />
<fo:table-column />
<fo:table-column />
<fo:table-column />
<fo:table-column />
<fo:table-column />
<fo:table-header>
<fo:table-row background-color="cmyk(0.72, 0.17, 0.03, 0.04)" color="#FFFFFF" font-size="15pt">
<fo:table-cell number-columns-spanned="7">
<fo:block padding="1mm" text-indent="0.3em">
<xsl:value-of select="$title" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:call-template name="result_table_header" />
</fo:table-header>
<fo:table-body>
<fo:table-row font-size="9pt">
<fo:table-cell number-columns-spanned="7">
<fo:block>
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
<fo:table-column column-width="1.8in" />
<fo:table-column />
<fo:table-column />
<fo:table-column />
<fo:table-column />
<fo:table-column />
<fo:table-column />
<fo:table-body>
<xsl:for-each select="result">
<xsl:call-template name="result_row" />
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:for-each>
更新#2
我修复了重叠,但我必须取出fo:marker
。它并没有添加“(cont.)”这些都可以在AH格式化程序V6.3中使用
有一种“在标题中伪造标题”的技巧:
<fo:table table-layout="auto" width="100%">
<fo:table-column column-width="1.8in" />
<fo:table-column />
<fo:table-column />
<fo:table-column />
<fo:table-column />
<fo:table-column />
<fo:table-column />
<fo:table-header>
<fo:table-row background-color="cmyk(0.72, 0.17, 0.03, 0.04)" color="#FFFFFF" font-size="15pt">
<fo:table-cell number-columns-spanned="7" padding-bottom="6pt">
<fo:block padding="1mm" text-indent="0.3em">
<fo:retrieve-table-marker retrieve-class-name="header-continued" retrieve-boundary-within-table="table" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell><fo:block>h</fo:block></fo:table-cell>
<fo:table-cell><fo:block>The real table header</fo:block></fo:table-cell>
<fo:table-cell />
<fo:table-cell />
<fo:table-cell />
<fo:table-cell />
<fo:table-cell />
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell number-columns-spanned="7"><fo:marker marker-class-name="header-continued">Title</fo:marker></fo:table-cell>
</fo:table-row>
<fo:table-row font-size="9pt">
<fo:marker marker-class-name="header-continued">Title (Cont)</fo:marker>
<fo:table-cell><fo:block>Lorem ipsum...</fo:block></fo:table-cell>
<fo:table-cell />
<fo:table-cell />
<fo:table-cell />
<fo:table-cell />
<fo:table-cell />
<fo:table-cell />
</fo:table-row>
</fo:table-body>
</fo:table>
H
真正的表格标题
标题
标题(续)
乱数假文。。。
以及“嵌套表”技术(如您所尝试的):
标题
标题(续)
H
真正的表格标题
乱数假文。。。
看看标题栏到底是什么,即它在哪些FO元素中?你能把它放到fo:table header
中吗?Title只是一个包含标题的fo:block
。是,类似于表格标题。@JoelM.Lamsen您知道FOP是否可能实现这一点吗?您的更新有一个错误。“如果共享同一父级的两个或多个fo:标记具有相同的“标记类名”属性值,则为错误。”()
<fo:table table-layout="auto" width="100%" break-before="page">
<fo:table-header>
<fo:table-row background-color="cmyk(0.72, 0.17, 0.03, 0.04)" color="#FFFFFF" font-size="15pt">
<fo:table-cell number-columns-spanned="7" padding-bottom="6pt">
<fo:block padding="1mm" text-indent="0.3em">
<fo:retrieve-table-marker retrieve-class-name="header-continued"
retrieve-boundary-within-table="table"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell number-columns-spanned="7"><fo:marker marker-class-name="header-continued">Title</fo:marker></fo:table-cell>
</fo:table-row>
<fo:table-row font-size="9pt">
<fo:table-cell>
<fo:marker marker-class-name="header-continued">Title (Cont)</fo:marker>
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
<fo:table-header>
<fo:table-row>
<fo:table-cell><fo:block>h</fo:block></fo:table-cell>
<fo:table-cell><fo:block>The real table header</fo:block></fo:table-cell>
<fo:table-cell />
<fo:table-cell />
<fo:table-cell />
<fo:table-cell />
<fo:table-cell />
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell><fo:block>Lorem ipsum...</fo:block></fo:table-cell>
<fo:table-cell></fo:table-cell>
<fo:table-cell></fo:table-cell>
<fo:table-cell></fo:table-cell>
<fo:table-cell></fo:table-cell>
<fo:table-cell></fo:table-cell>
<fo:table-cell></fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>