Ahmed Haddad wrote:
I have the same problem as Richard. On the web all examples I found do use
".fo" files with static contents.
[snip]
1* I have tried to use two simple page master:
<fo:simple-page-master master-name="letter" ...
<fo:region-body margin-top="0cm" margin-bottom="0cm"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="invoice" ...
<fo:region-body margin-top="9.1cm" margin-bottom="0.5cm"/>
<fo:region-before extent="9cm" />
</fo:simple-page-master>
2** Then I defined a <fo:page-sequence-master> to be able to alternate these
page masters:
I don't think you have to define a page sequence master for your
requirements.
[snip]
3*** Page sequences:
<fo:page-sequence master-reference="letter">
<fo:flow flow-name="xsl-region-body">
<fo:block>
<xsl:apply-templates select="
all_invoices/client/letter"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
<fo:page-sequence master-reference="type-crg">
<fo:static-content flow-name="xsl-region-before">
<fo:block>
<xsl:call-template name="invoice-header"/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>
<xsl:apply-templates select="
all_invoices/client/invoices/invoice"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
==> RESULTING PDF: I have all letters for all clients, and then all
invoices!! No alternating page masters.
No surprise here. You'll have to select the content from the source XML
in the way you want to have it processed.
Try something like the following:
<xsl:stylesheet ...>
<xsl:template match="/">
<fo:root ...>
<fo:layout-master-set ...>
... your simple page masters here ...
</fo:layout-master-set>
<xsl:for-each select="all_invoices/client">
<fo:page-sequence master-reference="letter">
... static content for the letter ...
<fo:flow flow-name="xsl-region-body">
<fo:block>
<fo:apply-templates select="letter"/>
</fo:block>
<fo:flow>
</fo:page-sequence>
<xsl:for-each select="invoices">
<fo:page-sequence master-reference="invoice">
... static content for an invoice ...
<fo:flow flow-name="xsl-region-body">
<fo:block>
<fo:apply-templates select="invoice"/>
</fo:block>
<fo:flow>
</fo:page-sequence>
</xsl:for-each>
</xsl:for-each>
</fo:root>
...
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]