XSL FO如何防止检索标记生成换行符?

时间:2018-03-29 08:25:53

标签: xsl-fo

我使用表来格式化表格标题。

当表标题很短时,“检索标记”会生成不需要的换行符,并且会在一行中显示。 当标题为一行并且在标题内生成换行符时,“检索标记”不会生成换行符。

当表格标题很短(只有几个字)时,是否可以防止此换行?

应该看起来像:

-------------------------------------
|Table 1   | Picture XYZ (continued)|
-------------------------------------

-----------------------------------------------------------------------------------------
|Table 1343   | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy|
|             | eirmod tempor invidunt ut labore et dolore magna aliquyam (continued)   |
-----------------------------------------------------------------------------------------

It should not look like:
------------------------------
|Table 1   | Picture         | 
|          | XYZ (continued) |
------------------------------

我目前的XSL-FO代码:

<fo:table table-layout="auto" inline-progression-dimension="auto">
    <fo:table-footer>
        <fo:table-row>
            <fo:table-cell>
                <fo:block>
                    <fo:inline white-space-treatment="ignore" keep-together.within-line="always">
                        <xsl:value-of select="$table_title"/>&#160;
                        <xsl:choose>
                            <xsl:when test="$chapter_number = 0"/>
                            <xsl:when test="$chapter_number = 1">
                                <fo:retrieve-marker retrieve-class-name="KapitelEbene1" retrieve-position="first-including-carryover" retrieve-boundary="page-sequence"/><xsl:number count="//content/pmentry" level="any" format="1"/><xsl:value-of select="$chapter_number_seperator"/>
                            </xsl:when>
                        </xsl:choose>
                        <xsl:call-template name="nummerierung_tabelle"/>
                        <xsl:text>&#160;&#160;&#160;</xsl:text>
                    </fo:inline>
                </fo:block>
            </fo:table-cell>
            <fo:table-cell>
                <fo:block>
                    <xsl:value-of select="ancestor::table/title"/>&#160;<fo:retrieve-marker retrieve-class-name="TableContinued" retrieve-position="last-ending-within-page" retrieve-boundary-within-table="page"/>
                </fo:block>
            </fo:table-cell>
        </fo:table-row>
    </fo:table-footer>
</fo:table>

1 个答案:

答案 0 :(得分:0)

&#160;没有突破空间。您不允许格式化程序在(continued)之前中断,因此当它将(continued)放在下一行时,必须将前一个字的(至少部分)拖到下一行。

我不清楚为什么格式化程序将短标题放在两行上,但尝试指定表格列的宽度,以便包含标题的列适当宽。