【问题标题】:How to give the border till the end of the body region?如何给边界直到身体区域的末端?
【发布时间】:2021-05-07 17:13:36
【问题描述】:

我们正在使用 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">

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

它希望它是这样的:

但边框只生成到内容而不是区域主体结束,输出如下所示:

我怎样才能产生所需的输出?

【问题讨论】:

    标签: xml xslt xsl-fo


    【解决方案1】:

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

    【讨论】:

    • 当我在 fo:region-body 使用边框属性时,它会导致验证异常“fo:region-body "xsl-region-body" 的边框和填充应为 '0'(参见 6.4.14在 XSL 1.1 中);如果启用了宽松验证,则允许使用非标准值。(没有可用的上下文信息)“您能否建议
    • 由于您使用的是 FOP,请使用 -r 参数运行它以启用轻松验证。见xmlgraphics.apache.org/fop/2.6/running.html#standalone-start
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-21
    • 1970-01-01
    • 2012-09-22
    • 1970-01-01
    • 1970-01-01
    • 2021-03-16
    相关资源
    最近更新 更多