2012-04-16 100 views
3

我會嘗試是最好的,我可以解釋這個...XSL-FO錶帶有重複標題

我生成XML和XSL-FO的PDF文件。該文檔有兩個帶表格標題的列。我希望只在到達新頁面時重複表格標題。它目前正在執行此操作,但表格標題在到達另一列時也會重複。我只想讓它在不同的頁面上重複。任何幫助將不勝感激。

下面是頭的XSL:

<xsl:template match="MAJOR"> 
    <fo:table rx:table-omit-initial-header="true" width="95%"> 

     <fo:table-column/> 
     <fo:table-header> 
      <fo:table-row keep-with-next="always"> 
       <fo:table-cell> 
        <fo:block font-family="Times New Roman" font-size="8pt" font-weight="bold"><xsl:value-of select="@NAME"/>--Cont'd</fo:block> 
       </fo:table-cell> 
       <fo:table-cell><fo:block/></fo:table-cell> 
      </fo:table-row> 
     </fo:table-header> 

     <fo:table-body> 
      <fo:table-row keep-with-next="always"> 
       <fo:table-cell> 
        <fo:block font-family="Times New Roman" font-size="8pt" font-weight="bold"><xsl:value-of select="@NAME"/></fo:block> 
       </fo:table-cell> 
       <fo:table-cell><fo:block/></fo:table-cell> 
      </fo:table-row> 
      <xsl:apply-templates/> 
     </fo:table-body> 
    </fo:table> 
</xsl:template> 

回答

0

難道你試試這樣嗎?如果這仍然不起作用,您是否可以附加數據xml文件?

<xsl:template match="/"> 
     <fo:table rx:table-omit-initial-header="true" width="95%"> 
      <fo:table-column/> 
       <fo:table-header> 
        <fo:table-row keep-with-next="always"> 
         <fo:table-cell> 
          <fo:block font-family="Times New Roman" font-size="8pt" font-weight="bold"><xsl:value-of select="@NAME"/>--Cont'd</fo:block> 
         </fo:table-cell> 
         <fo:table-cell><fo:block/></fo:table-cell> 
        </fo:table-row> 
       </fo:table-header> 

       <fo:table-body> 
        <xsl:for-each select="MAJOR"> 
        <fo:table-row keep-with-next="always"> 
         <fo:table-cell> 
          <fo:block font-family="Times New Roman" font-size="8pt" font-weight="bold"><xsl:value-of select="@NAME"/></fo:block> 
         </fo:table-cell> 
         <fo:table-cell><fo:block/></fo:table-cell> 
        </fo:table-row> 
       </xsl:for-each> 
      </fo:table-body> 
     </fo:table> 
    </xsl:template> 

編輯:只是格式化