如何给边界直到身体区域的末尾?

问题描述

我们正在使用 xsl-fo 创建 PDF。

我尝试使用

<xsl:attribute-set name="myBorder">
    <xsl:attribute name="border-bottom">0.0254cm solid black</xsl:attribute>
    <xsl:attribute name="border-right">0.0254cm solid black</xsl:attribute>
    <xsl:attribute name="border-left">0.0254cm solid black</xsl:attribute>
    <xsl:attribute name="border-top">0.0254cm solid black</xsl:attribute>
</xsl:attribute-set>
<fo:block xsl:use-attribute-sets="myBorder" height="225mm" width="195.0mm">

生成边框直到区域主体结束,但它没有按照我想要的方式生成

它希望它是这样的:

expected output

但是边框只生成内容直到区域主体结束,输出看起来像这样:

enter image description here

如何产生所需的输出

解决方法

fo:region-body 上指定边框(请参阅 https://www.w3.org/TR/xsl11/#fo_region-body),而不是在包含文本的 fo:block 等上指定边框。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...