需要使用xsl-fo创建静态页脚

时间:2012-10-02 20:06:07

标签: footer 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>         

1 个答案:

答案 0 :(得分: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>应该在体流之前声明,即使它出现在输出体后面。