Xsl fo 如果我在列表块中使用块容器,则忽略后面的空格

Xsl fo 如果我在列表块中使用块容器,则忽略后面的空格,xsl-fo,Xsl Fo,我有一个XML(用户手册),我正试图使用XSL-FO格式化它。在手册中,我们使用的样式之一是列表注释,它是列表(项目符号列表或编号列表)的一部分。例如: 列表项目符号文本 列表注释文本 注释有上边框和下边框。我试图在便笺的边框下方留出一些空间 进入我的渲染器(Antennahouse)的组合FO文件如下所示: <fo:list-item font-family="DIN-RegularAlternate" font-size="8pt" line-height="13pt" fon

我有一个XML(用户手册),我正试图使用XSL-FO格式化它。在手册中,我们使用的样式之一是列表注释,它是列表(项目符号列表或编号列表)的一部分。例如:

  • 列表项目符号文本


    列表注释文本


注释有上边框和下边框。我试图在便笺的边框下方留出一些空间

进入我的渲染器(Antennahouse)的组合FO文件如下所示:

<fo:list-item font-family="DIN-RegularAlternate" font-size="8pt" line-height="13pt" font-weight="normal" font-style="normal" space-before="2pt" space-after="2pt" keep-with-previous="10">
<fo:list-item-label end-indent="label-end()">
    <fo:block margin-left="0pt">-</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
    <!--List Bullet-->
    <fo:block background-color="transparent" font-family="DIN-RegularAlternate" font-size="8pt" line-height="13pt" font-weight="normal" font-style="normal" space-before="2pt" space-after="2pt">List Bullet text
        </fo:block>
    <!--List Note-->
    <fo:block-container start-indent="10mm" border-bottom="0.75pt solid rgb-icc(34,73,146,#Separation, 'PANTONE 287 C', 100%)" border-top="0.75pt solid rgb-icc(34,73,146,#Separation, 'PANTONE 287 C', 100%)" keep-together.within-column="always" space-before="0pt" space-after="12pt">
        <fo:block background-color="transparent" font-family="DIN-RegularAlternate" font-size="7pt" line-height="13pt" font-style="italic" space-before="0pt" space-after="0pt" color="rgb-icc(0,0,0,#CMYK,0%,0%,0%,80%)" padding-top="3pt" padding-bottom="3pt" padding-left="0pt" padding-right="6pt" start-indent="0pt" end-indent="6pt">Note text
            </fo:block>
    </fo:block-container>
</fo:list-item-body>
如果我将块容器移到列表块之外,就可以让它工作。但这是不可取的,因为这种注释样式必须在编号列表中可用;如果注释块位于列表块之外,列表的编号将重新开始。 我还可以在列表项目符号下找到一个很好的空格,这就是给我带来麻烦的注释。
我的结论是,在列表块中组合块容器会导致麻烦


如何控制便笺边框下方的空格?

显然,只有当您有两个同级块时,才会使用空格after属性。我最后在列表块中添加了以下空格:

<xsl:if test="(./para/@stylename='List Note') or (./para/@stylename='List Note 2')">
    <xsl:attribute name="space-after">6pt</xsl:attribute>
</xsl:if>

6pt
一位同事建议在我的原始代码中使用marginbottom而不是空格after,因为marginbottom在非同级块之间使用。不过我还没试过

<xsl:if test="(./para/@stylename='List Note') or (./para/@stylename='List Note 2')">
    <xsl:attribute name="space-after">6pt</xsl:attribute>
</xsl:if>