One possible solution, assuming no item contains another item, would be this:
<xsl:template match="item">
<fo:block xmlns:fo= <http://www.w3.org/1999/XSL/Format>
http://www.w3.org/1999/XSL/Format <http://www.w3.org/1999/XSL/Format"> ">
<xsl:if test="following::item">
<xsl:attribute name="break-after">page</xsl:attribute>
</xsl:if>
<-- call other templates -->
</fo:block>
</xsl:template>
If my assumption is wrong, you should be able to use "following::item |
descendant::item" for the test.
Eric Amick
Legislative Computer Systems
Office of the Clerk
________________________________
From: Sam Fuqua [mailto:[email protected]]
Sent: Thursday, March 26, 2009 14:24
To: [email protected]
Subject: break-after, Exclude last page
I'm generating a PDF from an xml feed. The feed has a list of items, and I
want each new item on a new page, but I don't want the last page to break onto
a new blank page. How would I do this?
Right now, I have the following:
<fo:page-sequence initial-page-number="1" master-reference="PageMaster">
<fo:static-content flow-name="xsl-region-before">
<fo:block font-size="8pt"
text-align="right"><fo:page-number/>/<fo:page-number-citation
ref-id="last-page"/></fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates/>
<fo:block id="last-page"/>
</fo:flow>
</fo:page-sequence>
<xsl:template match="item">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" break-after="page">
<-- call other templates -->
</fo:block>
</xsl:template>
--
Sam Fuqua
ΣΝ ΘΗ 454