2014-05-14 48 views
2

我对某个项目使用XSL-FO。我有一张桌子放在另一张桌子里,只是为了帮助将信息分组在一起(并且运作良好)。这个内部表格有一个国家的名称作为标题。该表可以分成不同的页面。 我需要在文本(continued)的下一页(已在工作)上重印国家的名称。xsl-fo备用表头

所以,在第3页的底部:

United States of America (continued) 
... ... ... remaining data 

我怎样才能插入此(continued)当在接下来的页面重复标题:

United States of America 
... ... ... data 

4页的开始?

谢谢!

+1

你可以发布表的XSL吗? – Vinit

+0

根据你使用的处理器(和版本)的不同,你可以使用fo-markers或fo:表格标记 – PhillyNJ

+0

@Vinit它只是一个常规表,每行只有一个单元格。在每个单元格内部,我还有另一个包含数据本身的表格(因为第一个表格只是帮助布局) – igorjrr

回答

1

这里是一个使用fo-markers的例子。我在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>