This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Newbie FOP question urgent plz? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Newbie FOP question urgent plz?" Watch "Newbie FOP question urgent plz?" New topic
Author

Newbie FOP question urgent plz?

Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
Hi
i have to generate a PDF report from an xml file "data.xml" and using FOP. now all i know is that there has to be a formating object xml file to be used by FOP. My question is how to generate FO file from data.xml everytime user asks for a report. If its using XSL how would i run that XSL file to generate the that XML and make it an input for the FOP.
Please guide me through the entire process on how to generate the required pdf from the xml file each time asked..
Thanks alot for any help
Regards
GUL
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
The simple answer is to use FO Processor like Apache FOP.
Check the servlet example after downloading the package,It takes XML and XSL as input and produces FO on the fly(in memory) and output the PDF stream.
http://xml.apache.org/fop/index.html => FOP Site.


Spritle Software Blogs
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Here's a more specific link to the FOP website: http://xml.apache.org/fop/servlets.html#xslt
Note that it's you who needs to write "foo-xml2fo.xsl" referred to in that example. For that purpose, you need to learn the XSL-FO schema (this page could help you with that).


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
GeeCON Prague 2014
 
subject: Newbie FOP question urgent plz?