xsl:include
is a top-level element (actually, a stylesheet declaration), which means that it may only appear as an immediate child of xsl:stylesheet
. So, you simply cannot include a stylesheet from within an fo:page-sequence
element.
But I think you're not in need of xsl:include
and a separate stylesheet, but of xsl:call-template
and a separate named template.
Write a separate template similar to the following:
<xsl:template name="footer-ebase">
<fo:static-content flow-name="footer" font-size="7pt">
<fo:table>
<fo:table-column column-width="70mm"/>
<fo:table-column column-width="70mm"/>
<fo:table-column column-width="70mm"/>
<fo:table-body>
<!--...-->
</fo:table-body>
</fo:table>
</fo:static-content>
</xsl:template>
In the main template (the place where you'd like to insert content), reference the named template with:
<fo:page-sequence master-reference="A4-portrait">
<xsl:call-template name="footer-ebase"/>
<fo:flow flow-name="xsl-region-body">
<!--...-->
</fo:flow>
</fo:page-sequence>
Note that it does not always make sense to write named templates. It is advisable if
- your code would otherwise be redundant because you need the same functionality in several places
- the code would clutter the template and make it hard to read
- you use recursion to solve a problem
If you want to split content into separate templates for no apparent reason, then you'd best do away with it alltogether.
You can still put the named template into a separate stylesheet if you wish, but then you need to use xsl:include
as a top-level element:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:include href="footer-ebase.xsl"/>
<!--...-->
</xsl:stylesheet>