XSL-FO - 空块元素
我有一个非常简单的模板:
<xsl:template match="p">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
即使块是空的,我如何告诉 FO 保留空行。
I have a quite simple template:
<xsl:template match="p">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
How do I tell FO to keep empty lines even if the block is empty.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只需在
末尾添加一个
元素即可。 像这样:领导者不会对有内容的行执行任何操作,并为没有内容的行创建一个空行。
使用 Apache FOP 和 XEP 进行了测试。
Just add a
<fo:leader/>
element at the end of your<fo:block>
. Like this:The leader will do nothing for lines with content, and will create an empty line for lines without content.
Tested with Apache FOP and XEP.
或者
Or
或者,
Alternatively,