xsl-list
[Top] [All Lists]

RE: [xsl] Multi page pdf using fop-one page for each person tag

2008-04-04 07:24:08
I do this exact thing for a bill of lading document where each
<SubShipment> is on it's own page. This is the basic FO I use...

<?xml version="1.0" encoding="UTF-8"?>
                
<xsl:stylesheet exclude-result-prefixes="fo" version="1.1"
xmlns:fo="http://www.w3.org/1999/XSL/Format";
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

        <xsl:output indent="yes" method="xml" omit-xml-declaration="no"
version="1.0"/>

        <xsl:template match="/">
                <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
                        <fo:layout-master-set>
                                <fo:simple-page-master
margin-bottom="1cm" margin-left=".5cm" margin-right=".5cm"
margin-top="1cm" master-name="main" page-height="29.7cm"
page-width="21cm">
                                        <fo:region-body/>
                                </fo:simple-page-master>
                        </fo:layout-master-set>
                        <fo:page-sequence master-reference="main">
                                <fo:flow flow-name="xsl-region-body">
                                        <xsl:apply-templates
select="//SubShipment"/>
                                </fo:flow>
                        </fo:page-sequence>
                </fo:root>
        </xsl:template> 

        <xsl:template match="SubShipment">

                <!--- ***** put your per page template in here *****
--->

        </xsl:template>

</xsl:stylesheet>

Just change SubShipment to person and insert your template.

~Jeremy

-----Original Message-----
From: Khan, Atique (IT) [mailto:Atiqur(_dot_)Khan(_at_)MorganStanley(_dot_)com] 
Sent: Friday, April 04, 2008 5:02 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Multi page pdf using fop-one page for each person tag

Hi All,
I need to convert my xml data using xsl-fo template into pdf using fop.
My XML data looks like

<resultset>
    <person>
    ...
    </person>
    <person>
    ...
    </person>
    <person>
    ...
    </person>
    .
    .
</resultset>

Each of the person tags need to go into a separate page in the pdf. Can
somebody please guide me with a sample xsl-fo template.

Thanks
Atique
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender
does not intend to waive confidentiality or privilege. Use of this email
is prohibited when received in error.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>