|
Subject: Re: [xsl] Multi page pdf using fop-one page for each person tag From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Fri, 04 Apr 2008 12:46:15 +0200 |
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.
T:\ftemp>type khan.xml
<resultset>
<person>
...
</person>
<person>
...
</person>
<person>
...
</person>
</resultset>T:\ftemp>type khan.xsl <?xml version="1.0" encoding="US-ASCII"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/XSL/Format" version="2.0">
<xsl:template match="/"> <root font-family="Times" font-size="20pt">
<layout-master-set>
<simple-page-master master-name="frame"
page-height="297mm" page-width="210mm"
margin-top="15mm" margin-bottom="15mm"
margin-left="15mm" margin-right="15mm">
<region-body region-name="frame-body"/>
</simple-page-master>
</layout-master-set>
<xsl:apply-templates/>
</root>
</xsl:template><xsl:template match="person">
<page-sequence master-reference="frame">
<flow flow-name="frame-body">
<block>This is a person</block>
</flow>
</page-sequence>
</xsl:template></xsl:stylesheet> T:\ftemp>xslt2 khan.xml khan.xsl khan.fo
-- Upcoming: UBL Apr.22,24; genericode code lists Apr.23; Rome,Italy World-wide corporate, govt. & user group XML, XSL and UBL training RSS feeds: publicly-available developer resources and training G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Multi page pdf using fop-one , Khan, Atique \(IT\) | Thread | RE: [xsl] Multi page pdf using fop-, Khan, Atique \(IT\) |
| Re: [xsl] Probelm with xsl:value-of, Colin Paul Adams | Date | RE: [xsl] Multi page pdf using fop-, Khan, Atique \(IT\) |
| Month |