我正在使用XSL-FO进行某些项目。我有一个表在另一个表中,只是为了帮助将信息组合在一起(并且它运行良好)。该内部表具有作为标题的国家名称。该表可以拆分为不同的页面。
我需要在下一页(已经有效)上使用文字(continued)
重新打印国家/地区的名称。
所以,在第3页的底部:
United States of America
... ... ... data
第4页开头:
United States of America (continued)
... ... ... remaining data
如果在下一页重复标题时如何插入此(continued)
?
谢谢!
答案 0 :(得分:2)
以下是使用fo标记的示例。我在FOP trunk中测试过,它在早期版本中不起作用。 FOP团队对标记的主干进行了重大改变。在主干版本中,它们更符合规范。这个例子不长;您需要添加内容以演示多页上的连续标记。
<fo:root xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="alternate-blank" page-height="11in" page-width="8.5in" margin-left="1.0in" margin-right="1.0in">
<fo:region-body/>
<fo:region-before region-name="header-blank" extent="11in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="page-even" page-height="11in" page-width="8.5in" margin-top="0.5in" margin-left="0.5in" margin-right="1.0in">
<fo:region-body region-name="xsl-region-body" margin-top="0.80in" margin-bottom=".5in" overflow="auto"/>
<fo:region-before region-name="xsl-region-before" extent="1in"/>
<fo:region-after region-name="xsl-region-after" extent="0.5in"/>
<fo:region-start extent="0in"/>
<fo:region-end extent="0in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence initial-page-number="1" force-page-count="end-on-even" format="1" master-reference="page-even" id="ps-0005">
<fo:static-content flow-name="xsl-region-before">
<fo:block line-height="12pt" font-family="sans-serif" font-size="10pt" font-weight="bold" text-align="center">HEADER</fo:block>
</fo:static-content>
<fo:static-content flow-name="header-blank">
<fo:block id="last-page-wp-d18e4446"/>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<fo:block line-height="10pt" font-family="sans-serif" font-size="8pt" font-weight="bold" text-align="center">PAGE FOOTER</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>Content</fo:block>
<fo:block>Content</fo:block>
<fo:block>Content</fo:block>
<fo:block>Content</fo:block>
<fo:block>Content</fo:block>
<fo:block>Content</fo:block>
<fo:block>Content</fo:block>
<fo:block>Content</fo:block>
<fo:block>Content</fo:block>
<fo:block>Content</fo:block>
<fo:block>Content</fo:block>
<fo:block>Content</fo:block>
<fo:block>Content</fo:block>
<fo:table line-height="12pt" font-family="sans-serif" font-size="10pt" table-layout="fixed" width="100%" space-before="6pt">
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block line-height="12pt" font-family="sans-serif" font-size="10pt" font-weight="bold" space-before.optimum="12pt" space-after.optimum="6pt" keep-with-next="always">PARA TITLE<fo:retrieve-table-marker retrieve-class-name="primary-para-continuation" retrieve-position-within-table="first-starting" retrieve-boundary-within-table="table"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<!--fo:marker marker-class-name="primary-para-continuation"/-->
<fo:table-row>
<fo:table-cell>
<!--fo:marker marker-class-name="primary-para-continuation"> - Cont</fo:marker-->
<fo:marker marker-class-name="primary-para-continuation"/>
<fo:block line-height="12pt" font-family="sans-serif" font-size="10pt" keep-with-next="100"/>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:marker marker-class-name="primary-para-continuation"> - Cont</fo:marker>
<fo:block line-height="12pt" font-family="sans-serif" font-size="10pt">
<fo:marker marker-class-name="primary-para-continuation"> - Cont</fo:marker>
<fo:table table-layout="fixed" width="100%" id="d18e2057">
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:marker marker-class-name="table-caption-continued"/>
<fo:table-row>
<fo:table-cell padding-before="1pt">
<fo:table table-layout="fixed" space-before.optimum="12pt" space-after.optimum="6pt" start-indent="0in" width="7in">
<fo:table-column column-width="proportional-column-width(1.00)"/>
<fo:table-column column-width="proportional-column-width(2.20)"/>
<fo:table-body>
<fo:marker marker-class-name="table-caption-continued"/>
<fo:table-row keep-together.within-column="always" text-align="left">
<fo:table-cell wrap-option="wrap" padding-end="3pt" padding-start="3pt" padding-before="3pt" padding-after="3pt" border-start-style="solid" border-start-width="1pt" border-top-style="solid" border-top-width="1pt" border-bottom-style="solid" border-bottom-width="1pt" border-end-style="solid" border-end-width="1pt">
<fo:marker marker-class-name="table-caption-continued"> - Continued </fo:marker>
<fo:block line-height="12pt" font-family="sans-serif" font-size="10pt" space-after.optimum="5pt">
<fo:inline font-weight="bold">Column 1 Header</fo:inline>
</fo:block>
</fo:table-cell>
<fo:table-cell wrap-option="wrap" padding-end="3pt" padding-start="3pt" padding-before="3pt" padding-after="3pt" border-start-style="solid" border-start-width="1pt" border-top-style="solid" border-top-width="1pt" border-bottom-style="solid" border-bottom-width="1pt" border-end-style="solid" border-end-width="1pt">
<fo:marker marker-class-name="table-caption-continued"> - Continued </fo:marker>
<fo:block line-height="12pt" font-family="sans-serif" font-size="10pt" space-after.optimum="5pt">
<fo:inline font-weight="bold">Column 2 Header</fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row keep-together.within-column="always" text-align="left">
<fo:table-cell wrap-option="wrap" padding-end="3pt" padding-start="3pt" padding-before="3pt" padding-after="3pt" border-top-style="solid" border-top-width="1pt" border-start-style="solid" border-start-width="1pt" border-bottom-style="solid" border-bottom-width="1pt" border-end-style="solid" border-end-width="1pt">
<fo:marker marker-class-name="table-caption-continued"> - Continued </fo:marker>
<fo:block line-height="12pt" font-family="sans-serif" font-size="10pt" space-after.optimum="5pt">Data1 </fo:block>
</fo:table-cell>
<fo:table-cell wrap-option="wrap" padding-end="3pt" padding-start="3pt" padding-before="3pt" padding-after="3pt" border-top-style="solid" border-top-width="1pt" border-start-style="solid" border-start-width="1pt" border-bottom-style="solid" border-bottom-width="1pt" border-end-style="solid" border-end-width="1pt">
<fo:marker marker-class-name="table-caption-continued"> - Continued </fo:marker>
<fo:block line-height="12pt" font-family="sans-serif" font-size="10pt" space-after.optimum="5pt">Content</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block> </fo:block>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>