2012-10-02 27 views
0

在我的文檔底部,我有一個地址,我需要留在最下面,以便地址可以在窗口郵件程序中使用。我曾嘗試使用靜態內容標籤來實現這一點,但每次都會出現文檔錯誤。我對此很陌生,所以我猜想我錯過了一些東西。我希望「承包商」模板在頁腳中是靜態的。需要用xsl-fo創建一個靜態頁腳

<xsl:template match="/" > 
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> 
<fo:layout-master-set> 
<!-- Setup up page size (Can be in inches or centimeters)--> 
    <fo:simple-page-master 
    master-name="page" 
    page-width="8.50in" 
    page-height="11.00in" 
    margin-top="0.50in" 
    margin-bottom="0.50in" 
    margin-left="0.50in" 
    margin-right="0.50in"> 
    <fo:region-body margin-top="0cm"/> 
    <fo:region-before extent="0cm"/> 
    <fo:region-after extent="0cm"/> 
    </fo:simple-page-master> 
</fo:layout-master-set> 

<xsl:apply-templates select="/Permits/Permit" /> 

</fo:root> 
</xsl:template> 

<xsl:template match="Permit"> 
<fo:page-sequence master-reference="page"> 
    <fo:flow flow-name="xsl-region-body"> 
    <fo:block font-size="10pt"> 
     <xsl:call-template name="header"/> 
     <xsl:call-template name="permitdetails"/> 
     <xsl:call-template name="permitdetails2"/> 
     <xsl:call-template name="parties"/> 
     <xsl:call-template name="feesummary"/> 
     <xsl:call-template name="inspections"/> 
     <xsl:call-template name="contractor"/> 
    </fo:block> 
    </fo:flow> 
    </fo:page-sequence> 
    </xsl:template>   
+0

你得到的錯誤是什麼? – Satya

+0

錯誤信息爲「文件已損壞,無法修復」。 發生這種情況時,我已經從上面的代碼中取出了靜態內容標籤。因爲我認爲我錯誤地使用了它們。 – Stedman

回答

1

<fo:static-content>應該是<fo:page-sequence>一個孩子,如果你只是想換你<xsl:call-template name="contractor"/>以上靜態內容標籤應該不行。你可以發佈你的模板的錯誤?

像這樣的東西應該工作:

<xsl:template match="Permit"> 
    <fo:page-sequence master-reference="page"> 
    <fo:static-content flow-name="xsl-region-after"> 
     <fo:block> 
     <xsl:call-template name="contractor"/> 
     </fo:block> 
    </fo:static-content> 
     <fo:flow flow-name="xsl-region-body"> 
     <fo:block font-size="10pt"> 
      <xsl:call-template name="header"/> 
      <xsl:call-template name="permitdetails"/> 
      <xsl:call-template name="permitdetails2"/> 
      <xsl:call-template name="parties"/> 
      <xsl:call-template name="feesummary"/> 
      <xsl:call-template name="inspections"/> 
     </fo:block> 
     </fo:flow> 
    </fo:page-sequence> 
    </xsl:template> 
</xsl:template> 

<fo:static-content>應該體內流之前聲明,即使它出現在輸出後身體。