hi there !!

i am sending u the code of my XSL and XML... though the code might be slightly 
big but if u r able to find a solution to it then nothing like it... this set 
of XSL and XML should be able to print around 300 - 500 pages but currently it 
prints hardly 40...

THE XSL CODE: -
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0" 
xmlns:fo="http://www.w3.org/1999/XSL/Format";>
<xsl:strip-space elements="*"/>
<xsl:param name="page-count" select="'#'"/>
<xsl:template match="library">

<fo:root  xmlns:fo="http://www.w3.org/1999/XSL/Format";>
    <!-- Setting physical dimensions of the page -->
    <fo:layout-master-set>
        <fo:simple-page-master master-name="first" margin-right="2.0cm" 
margin-left="2.0cm" margin-bottom="1.0cm" margin-top="1.0cm" 
page-width="29.7cm" page-height="21cm">
            <fo:region-before extent="1.5cm"/>
            <fo:region-body margin-bottom="1.5cm" margin-top="1.5cm"/>
            <fo:region-after extent="1.0cm"/>
        </fo:simple-page-master>
    </fo:layout-master-set>

    <fo:page-sequence master-reference="first" language="en" hyphenate="true" 
initial-page-number="1">
        <fo:static-content flow-name="xsl-region-before">
            <fo:block font-size="10pt" keep-together="always">
                <xsl:apply-templates select="pagetitle"/>
            </fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-region-after">
            <fo:block font-size="10pt" keep-together="always" 
text-align="right">
                <!--Page #<fo:page-number/> of <fo:page-number-citation 
ref-id="last"/>-->
                Page #<fo:page-number/> of <xsl:value-of select="$page-count"/>
            </fo:block>
        </fo:static-content>

        <!-- Display Data justifyS Here -->
        <fo:flow flow-name="xsl-region-body">
            <fo:table border="0.25pt solid black" width="750pt" 
table-layout="fixed" break-after="even-page">
                <fo:table-column column-width="150pt"/>
                <fo:table-column column-width="120pt"/>
                <fo:table-column column-width="120pt"/>
                <fo:table-column column-width="80pt"/>
                <fo:table-column column-width="270pt"/>
                <fo:table-header>
                    <fo:table-row>
                        <fo:table-cell border="0.1pt solid black">
                            <fo:block text-align="center" font-weight="bold" 
font-size="12pt">
                                Title
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell border="0.1pt solid black">
                            <fo:block text-align="center" font-weight="bold" 
font-size="12pt">
                                Author
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell border="0.1pt solid black">
                            <fo:block text-align="center" font-weight="bold" 
font-size="12pt">
                                Publisher
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell border="0.1pt solid black">
                            <fo:block text-align="center" font-weight="bold" 
font-size="12pt">
                                ISBN
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell border="0.1pt solid black">
                            <fo:block text-align="center" font-weight="bold" 
font-size="12pt">
                                Comments
                            </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-header>
                <!-- Table Body STARTS Here-->
                <fo:table-body>
                    <xsl:for-each select="book">
                        <fo:table-row>
                            <fo:table-cell border="0.1pt solid black" 
padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt">
                                <fo:block text-align="justify" 
font-size="10pt">
                                    <xsl:apply-templates select="title"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.1pt solid black" 
padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt">
                                <fo:block text-align="justify" 
font-size="10pt">
                                    <xsl:apply-templates select="author"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.1pt solid black" 
padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt">
                                <fo:block text-align="justify" 
font-size="10pt">
                                    <xsl:apply-templates select="publisher"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.1pt solid black" 
padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt">
                                <fo:block text-align="justify" 
font-size="10pt">
                                    <xsl:apply-templates select="isbn"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="0.1pt solid black" 
padding-start="3pt" padding-end="3pt" padding-before="3pt" padding-after="3pt">
                                <fo:block text-align="justify" 
font-size="10pt">
                                    <xsl:apply-templates select="comments"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                    </xsl:for-each>
                </fo:table-body>
                <!-- Table Body ENDS Here-->
            </fo:table>
            <!--<fo:block id="last"></fo:block>-->
        </fo:flow>
        <!-- Display Data ENDS Here -->
    </fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>

THE XML CODE: -
<library>
<pagetitle>List of Books</pagetitle>
<book>
        <title>Discovery of India</title>
        <author>Pandit Jawaharlal Nehru</author>
        <publisher>Tata McGraw Hill</publisher>
        <cover type='paperback'/>
        <category class='historical'/>
        <isbn>1-23-456-7890</isbn>
        <rating number='5'/>
        <comments>Tells about history of India right from its birth</comments>
</book>
... mutiple book tags are there and finally the closing tag i.e.
</library>

Currently i want to print around 3000 - 4000 rows of in a table in the PDF... 
but the total page count does not go beyond 40... actually it should go to 
140... similarly if the number of rows increases then the number of pages will 
also increase.
NOTE: - this is just anexample XML.

Reply via email to