我使用apache FOP生成pdf文件。我有這樣的XSL代碼如何使用`xsl:include`與apache fop
<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>
通知元素<xsl:include href="footer_common.xsl"/>
列入不工作! 這裏是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>
兩者的.xsl文件都在同一個資源目錄。如果它很重要 - 我使用eclipse進行開發。在我的java代碼中,我將主要的.xsl文件作爲資源流獲取並用於轉換。
的錯誤消息是 xsl:include ist an dieser Position in der Formatvorlage nicht zulässig!
這意味着,xsl:include is not allowed at that position in the template
有人能看到我在做什麼錯?
感謝您的任何幫助或提示。