问题
When working with big xml files fop breaks down due to the lack of ram(1.7gb in my case, is the limit), so one of the ways to fix this is to use multiple page sequence objects as described here . However the are no description how to use them... And what I tried to do is to "create" a new page sequence objects using for-each, but it seems that I have failed and fob breaks down when it reaches 1.7gb of ram anyways
<xsl:template match="OurForm">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:call-template name="layout_master_template"/>
<xsl:for-each select="document"> //Hopefully this creates a new page-sequence object, doesn't it?
<fo:page-sequence master-reference="page" initial-page-number="1" force-page-count="no-force">
<fo:flow flow-name="xsl-region-body">
<fo:block xsl:use-attribute-sets="pageBlock">
<xsl:call-template name="MainTemplate">
<xsl:with-param name="PageCount" select="0"/>
</xsl:call-template>
</fo:block>
</fo:flow>
</fo:page-sequence>
</xsl:for-each>
</fo:root>
</xsl:template>
MainTemplate takes few hundred records and prints them to the table...
XML:
...
<document>
records
</document>
...
900 documents
...
<document>
records
</document>
Does for-each create a new page-sequence object every time it takes a new document from xml? and how would you fix this memory issue?
来源:https://stackoverflow.com/questions/10582563/fixed-multiple-page-sequence-objects