Stedman
Stedman

Reputation: 87

Need to create a static footer with xsl-fo

At the bottom of my document, I have an address that I need to stay at the bottom so the address can be used in window mailers. I have tried using static-content tags to achieve this, but my document errors out every time. I am new to this, so I'm guessing I missing something. I want the "contractor" template to be static in the footer.

 <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>         

Upvotes: 0

Views: 1731

Answers (1)

ashovlin
ashovlin

Reputation: 169

<fo:static-content> should be a child of <fo:page-sequence> It should not work if you were simply trying to wrap your <xsl:call-template name="contractor"/> above in static-content tags. Can you post your template with the error?

Something like this should work:

<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> should be declared before the body flow, even if it appears after the body in the output.

Upvotes: 1

Related Questions