2014-05-14 84 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>