I use apache FOP to generate pdf files. I have this xsl code
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:output method="xml" indent="yes" /> <xsl:template match="/"> <fo:root font-size="11pt" font-family="serif"> <fo:layout-master-set> <fo:simple-page-master master-name="A4-portrait" page-height="29.7cm" page-width="21.0cm" margin-top="1cm" margin-left="1.5cm" margin-right="1cm" margin-bottom="1cm"> <fo:region-body /> <fo:region-after region-name="footer" extent="15mm"/> </fo:simple-page-master> <fo:simple-page-master master-name="A4-landscape" page-width="29.7cm" page-height="21.0cm" margin-top="1cm" margin-left="1cm" margin-right="1cm" margin-bottom="1cm"> <fo:region-body /> <fo:region-after region-name="footer2" display-align="after" extent="0cm"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="A4-portrait"> <xsl:include href="footer_common.xsl"/> <fo:flow flow-name="xsl-region-body"> .... </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> </xsl:stylesheet>
Notice the element <xsl:include href="footer_common.xsl"/>
The inclusion does not work! And here is footer_common.xsl:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <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:stylesheet>
Both .xsl files are in the same resource directory. If it matters - I use eclipse for development. In my java code I get the main .xsl file as a resource stream and use it for the transformation.
The error message is which means,
xsl:include is not allowed at that position in the template
Can anyone see what I am doing wrong?
Thanks for any help or hints.