[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Sample Code for multiple fo:page-sequence

Subject: Sample Code for multiple fo:page-sequence
From: "Prateek Gupta" <pgupta@xxxxxxxxxx>
Date: Thu, 19 Dec 2002 15:52:23 -0500
fo table example
I am generating a big PDF report comprising of hundreds of pages, and I get
outOfMemory messages. I am using no images,  I have already adjusted the
-Xms and -Xmx vals to 256M/512M on my 512M NTmachine. I do not have any
"Page x of y" type of references. Based on apache's recommendation,  one
big reason for continuing to get the outOfMemory is because of I have all
of my data based in a single table which in turn is inside a single
sequence.I can have multiple sequences in one of 2 ways:
- call for a fresh page sequence after, say every 20 records (preferable,
since the data volume varies for each record).
- call for a page sequence per new page, wherein I specify that the number
of records per page is, say, 5
Can anyone point out how I can re-code my XSL.

An simplified example of my XML is:
<ROWSET>
      <ROW>
            <SSN></SSN>
            <NAME></NAME>
            <ADDRESS></ADDRESS>
            <INFO>This text could run into 1 or more sentences depending on
the record</INFO>
      </ROW>
      <ROW>
      - - - - - - - - - - -
      </ROW>
      - - - - - - -
</ROWSET>

My XSL looks like this:
<fo:page-sequence master-reference="default-master">
  <fo:static-content flow-name="xsl-region-before">
    ---------
  </fo:static-content>

  <fo:static-content flow-name="xsl-region-after">
    ----------
  </fo:static-content>

  <fo:flow flow-name="xsl-region-body">
    <fo:table table-layout="fixed">
      <fo:table-column column-width="20mm" background-color="white"/>
      <fo:table-column column-width="43mm" background-color="white"/>
      <fo:table-column column-width="20mm" background-color="white"/>
      <fo:table-column column-width="43mm" background-color="white"/>
      <fo:table-header>
        - - - - - - - - -
      </fo:table-header>
      <fo:table-body>
        <xsl:apply-templates select="document
('AllEmployees.xml')/ROWSET/ROW">
        </xsl:apply-templates>
      </fo:table-body>
    </fo:table>
  </fo:flow>
</fo:page-sequence>

<xsl:template match="ROW">
    <fo:table-row keep-with-next="always">
      <fo:table-cell>
        <fo:block><xsl:value-of select="SSN"/></fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block><fo:block><xsl:value-of select="NAME"/></fo:block>
      </fo:table-cell>
      <fo:table-cell padding="1.0pt">
        <fo:block><xsl:value-of select="ADDRESS"/></fo:block>
      </fo:table-cell>
      <fo:table-cell padding="1.0pt">
        <fo:block><xsl:value-of select="INFO"/></fo:block>
      </fo:table-cell>
    </fo:table-row>
</template>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.