On Feb 27, 2007, at 14:22, Maheswaran wrote:
Hi,
I am doing a report generation. I am using FOP to generate PDF
file. I am
using xsl:fo for formatting.Presently i am defining the header,
body, footer
in the same page master as follows
<fo:simple-page-master master-name="RejectedInput">
<fo:region-before region-name="header-main" extent="50mm"/>
<fo:region-body />
<fo:region-after region-name="footer-main" extent="20mm" />
</fo:simple-page-master>
I need to seperate the header and footer in seperate file so that any
change in the header and footer can be accomodated easily.
is it possible to get the header and footer from seperate xsl file and
import it to the main xsl file.
Can u guide me in this regard?...
If I understand the issue correctly, then I personally do something
similar:
* the part above --the page-master-- still remains in the main .xsl file
* the fo:static-contents that will end up in those headers/footers
are defined in named templates in a separate .xsl file, referenced by
the main .xsl through xsl:include
Example:
In the separate stylesheet, name it 'headers-footers.xsl', you'll
have some templates like:
<xsl:template name="Header">
<fo:static-content flow-name="xsl-region-before">
<fo:block>...</fo:block>
</fo:static-content>
</xsl:template>
<xsl:template name="Footer">
<fo:static-content flow-name="xsl-region-after">
<fo:block>...</fo:block>
</fo:static-content>
</xsl:template>
In the main .xsl, you'll then need something like:
<xsl:include href="./headers-footers.xsl" />
...
<xsl:template match="...">
<fo:page-sequence master-reference="...">
<xsl:call-template name="Header" />
<xsl:call-template name="Footer" />
<fo:flow flow-name="xsl-region-body">
....
</fo:flow>
</fo:page-sequence>
</xsl:template>
HTH!
Cheers,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]