【发布时间】:2019-05-23 02:22:07
【问题描述】:
我有一个可能跨越页面的 fo:block。我想在该块所在的第一页底部放置一些文本,例如“继续”。
源文档在
我能看到的唯一方法是在源文档的正确位置添加
是否有一个测试块是否跨越页面?
源文件:
<recipe page-break="auto">
<instructions>
<step>The first thing to do</step>
<step>The second thing to do</step>
</instructions>
<recipe>
样式表的相关部分:
<xsl:template match="recipe">
<xsl:variable name="pbi"><xsl:choose><xsl:when test="@page-break"><xsl:value-of select="@page-break"/></xsl:when><xsl:otherwise>avoid</xsl:otherwise></xsl:choose></xsl:variable>
<xsl:variable name="pbb"><xsl:choose><xsl:when test="@page-break">always</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:variable>
<fo:block page-break-inside="{$pbi}" page-break-before="{$pbb}" margin-bottom="1.5em">
<xsl:apply-templates select="instructions/step" mode="plain"/>
</fo:block>
</xsl:template>
谢谢。
【问题讨论】:
-
如果我理解正确,如果
<recipe>的格式跨越多个页面,您希望显示“继续”,对吗?
标签: xsl-fo