[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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


Subject: RE: [xsl] Multi page pdf using fop-one page for each person tag
From: "Ferry, Jeremy" <Jeremy_Ferry@xxxxxxxxxxxx>
Date: Fri, 4 Apr 2008 09:23:31 -0500

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.Khan@xxxxxxxxxxxxxxxxx]
Sent: Friday, April 04, 2008 5:02 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
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.


Current Thread
Keywords
xml