|
|
 |
| XML General XML discussions. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the XML section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

March 25th, 2008, 02:58 AM
|
|
Registered User
|
|
Join Date: Mar 2008
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Multiple FOP files to single PDF using XSL
hi ,
can anybody tell me is there a method to convert multiple FOP files to single PDF document using XSLt...
The requirement is tat we have multiple html files that needs to be
converted to FOP files, since XSLt processor cmd does not allow multiple html files to be converted to single fop file....
we need to convert the multiple FOP files to single pdf document using xslt.....
|

March 25th, 2008, 08:21 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Location: , , .
Posts: 366
Thanks: 8
Thanked 0 Times in 0 Posts
|
|
Hi,
By FOP files do you mean xsl-fo (myfile.fo)?
If so, I use the SAXON 9.0 XSLT 2.0 processor for converting XML to FO. SAXON allows the uses of the collection() function which can process all files in a folder. Then I use FOP to convert the FO to PDF. Its a two step process. This is also useful, so I can troubleshoot any errors in my FO.
My XSLT calls up about 800 xml files and creates one FO file, which is then converted to PDF with FOP 0.94. This way I can create a "book" with an LEP, TOC, INDEX etc.. from 800 XML files.
|

March 25th, 2008, 08:47 AM
|
|
Registered User
|
|
Join Date: Mar 2008
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
my requirement is to convert multiple html files to single pdf document using xslt.... fo means myfile.fo file itself....
|

March 25th, 2008, 10:54 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Location: , , .
Posts: 366
Thanks: 8
Thanked 0 Times in 0 Posts
|
|
Hi,
Then my example applies.
Create an XSLT 2.0 file, that will take all your XHTML files and create 1 (one) FO. Then transform to PDF with FOP.
Good luck
|

March 26th, 2008, 12:31 AM
|
|
Registered User
|
|
Join Date: Mar 2008
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks ...tat really helped me a lot.... can u put the link for the example u have
|

March 26th, 2008, 06:16 AM
|
 |
Wrox Author
Points: 12,735, Level: 48 |
|
|
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 3,923
Thanks: 0
Thanked 82 Times in 80 Posts
|
|
You seem to be having trouble knowing where to start, but it's difficult to help you because you've told us so little about the problem. If I were you I would spend a little time reading - you'll find lots of worked examples in my XSLT Programmer's Reference book for example.
There are two particular aspects raised by your problem:
(a) your input is HTML but XSLT requires XML. There are many ways to convert HTML to XML (for example using jtidy) - it depends a lot on how "clean" the HTML is to start with, and on how you want to deploy this application (is it a one-off, or a regular production job?)
(b) your transformation needs to read multiple input files. That's not difficult - you can read them using the document() or collection() functions - but the details depend on how you want to supply the list of files. Are you processing all the files in a directory? Or are you following hyperlinks from one document to another?
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|

March 27th, 2008, 02:19 AM
|
|
Registered User
|
|
Join Date: Mar 2008
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ya wat u said was right... i went through some examples...
my requirement kept on changing...
we wanted to develop "help" for our application like the one in eclipse ...
so i used xalan to convert xml or html to fop files and then to pdf files...
i was asked to merge the multiple html or xml docs to one single html or xml.... i did tat ...but they were not satisfied with the solution...
so they came up with another option .... it was tat multiple pdf docs say chapter1,2,3,.... needs to be merged to single pdf doc.... so tat whenever i make a change in some section of chapter 3...or new chapter is added... the chapter and section numbers need to be automatically updated in merged pdf....
i tried using pdf merger tool...but it didn support for chapter numbers or section numbering automatically changed....
can anybody help me in finding the tool
|

March 28th, 2008, 06:59 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Location: , , .
Posts: 366
Thanks: 8
Thanked 0 Times in 0 Posts
|
|
Hi,
I know exactly what you are trying to do. Why dont you try my approach?
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |