Divide your file up in multiple page-sequences with grouping by position.
I had the same problem, look at this example :

T:\ftemp>type prateek.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<table>
   <row>Row 1</row>
   <row>Row 2</row>
   <row>Row 3</row>
   <row>Row 4</row>
   <row>Row 5</row>
   <row>Row 6</row>
   <row>Row 7</row>
   <row>Row 8</row>
   <row>Row 9</row>
   <row>Row 10</row>
   <row>Row 11</row>
   <row>Row 12</row>
   <row>Row 13</row>
   <row>Row 14</row>
   <row>Row 15</row>
   <row>Row 16</row>
   <row>Row 17</row>
   <row>Row 18</row>
   <row>Row 19</row>
   <row>Row 20</row>
   <row>Row 21</row>
   <row>Row 22</row>
   <row>Row 23</row>
   <row>Row 24</row>
   <row>Row 25</row>
   <row>Row 26</row>
   <row>Row 27</row>
</table>
T:\ftemp>type prateek.xsl
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                 version="1.0">

<xsl:output indent="yes"/>

<xsl:template match="table">
   <result>
     <xsl:for-each select="row[ position() mod 5 = 1 ]">
       <page-sequence>
         <table>
           <xsl:copy-of select="."/>
           <xsl:for-each select="following-sibling::row[ position() &lt; 5 ]">
             <xsl:copy-of select="."/>
           </xsl:for-each>
         </table>
       </page-sequence>
     </xsl:for-each>
   </result>
</xsl:template>

</xsl:stylesheet>

T:\ftemp>xt prateek.xml prateek.xsl
<?xml version="1.0" encoding="utf-8"?>
<result>
<page-sequence>
<table>
<row>Row 1</row>
<row>Row 2</row>
<row>Row 3</row>
<row>Row 4</row>
<row>Row 5</row>
</table>
</page-sequence>
<page-sequence>
<table>
<row>Row 6</row>
<row>Row 7</row>
<row>Row 8</row>
<row>Row 9</row>
<row>Row 10</row>
</table>
</page-sequence>
<page-sequence>
<table>
<row>Row 11</row>
<row>Row 12</row>
<row>Row 13</row>
<row>Row 14</row>
<row>Row 15</row>
</table>
</page-sequence>
<page-sequence>
<table>
<row>Row 16</row>
<row>Row 17</row>
<row>Row 18</row>
<row>Row 19</row>
<row>Row 20</row>
</table>
</page-sequence>
<page-sequence>
<table>
<row>Row 21</row>
<row>Row 22</row>
<row>Row 23</row>
<row>Row 24</row>
<row>Row 25</row>
</table>
</page-sequence>
<page-sequence>
<table>
<row>Row 26</row>
<row>Row 27</row>
</table>
</page-sequence>
</result>

Renzo Callant
Belgium

-----Oorspronkelijk bericht-----
Van: Jean-Philippe VALENTIN [mailto:[EMAIL PROTECTED]
Verzonden: vrijdag 20 december 2002 15:30
Aan: '[EMAIL PROTECTED]'
Onderwerp: FOP : OutOfMemoryError with a big XML file


Hi,

When I want transform my XML + XSL file I have got this error :
...
[INFO] [28]
Exception in thread "main" java.lang.OutOfMemoryError

(PS: I have 256Mo of RAM with 631Mo of limit and the error appear at 260Mo
of RAM use)

When I reduce the size of the XML file, it's work correctly.

What is the problem ?

Thanks

Jean-Philippe VALENTIN

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to