I am trying to set a footer only in the first page of a RTF document.
Approach
I defined two regions to show one in the first page and the other in the rest of pages. Once it is done, I could just remove the second footer text to achieve my goal (the generated rtf document only has two pages).
Result
Unfortunately with the transformation below I am getting the "Rest of pages footer" in both pages. It seems XSL-FO never catches the matching criteria for page-position="first". I also tried a similar approach with odd-or-even="odd" in the conditional-page-master-reference with the same result.
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="first"
page-height="29.7cm" page-width="21.0cm" margin-left="2.54cm"
margin-right="2.54cm" margin-top="1cm" margin-bottom="2.54cm">
<fo:region-body margin-top="1.54cm"/>
<fo:region-after region-name="footer-first" extent="2cm" display-align="after"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="rest"
page-height="29.7cm" page-width="21.0cm" margin-left="2.54cm"
margin-right="2.54cm" margin-top="1cm" margin-bottom="2.54cm">
<fo:region-body margin-top="1.54cm"/>
<fo:region-after region-name="footer-rest" extent="2cm" display-align="after" />
</fo:simple-page-master>
<fo:page-sequence-master master-name="document">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference page-position="first" master-reference="first" />
<fo:conditional-page-master-reference page-position="rest" master-reference="rest" />
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<xsl:template match="WC">
<xsl:variable name="id.wc">id_<xsl:value-of select="normalize-space(Id/text())"/>
</xsl:variable>
<fo:page-sequence master-reference="document"
padding-top="1cm" initial-page-number="1">
<fo:static-content flow-name="footer-first">
<fo:block padding-top="10pt" font-size="8">
<fo:inline color="grey">
First page footer
</fo:inline>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="footer-rest">
<fo:block text-align-last="center">Rest of pages footer</fo:block>
</fo:static-content>
<!-- Body continues... -->