13

On a company that I've worked, me and my colleagues, implemented a tailored document distribution system on top of XSL-FO.

My task was to get the script to deliver the documents and configure the CUPS print server and the Fax server, so I never had the time to get my hands dirty on XSL-FO.

I'm thinking of implementing something in the region that was made there but I'll need some templates to work with while testing.

Where can I find some good tutorials on XSL-FO, since the fop process I've mastered already?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76
  • ##Why XSL-FO? Do you know "CSS+XHTML to PDF" technologies?## See [Why use XSL-FO instead of CSS2, for transform HTML into good PDF?](http://stackoverflow.com/q/10641667/287948) question and answers. – Peter Krauss Jul 26 '12 at 18:20

8 Answers8

12

I like to refer people to this 2003 IBM developerWorks article: HTML to Formatting Objects (FO) conversion guide

I don't recommend using the provided .xsl to convert HTML to FO, but use the narrative to understand the different XSL-FO constructs and how they relate to HTML (which we all understand).

Kevin Hakanson
  • 41,386
  • 23
  • 126
  • 155
4

First, before you buy a commercial engine, check out Apache FOP it is a pretty solid XSL-FO engine. I've used it extensively for "government" form generation.

If you're just getting started. W3schools is invaluable in learning XSL-FO: http://www.w3schools.com/xslfo/default.asp

If you're new to XSL, I highly recommend the list @ http://www.mulberrytech.com/xsl/xsl-list/index.html, even for just searching for common solutions to common problems.

Gavin M. Roy
  • 4,551
  • 4
  • 33
  • 29
4

You can also try a visual xsl-fo designer/editor. If you still want to write XSL by hand, take a look at XSL-FO tutorial from XML 1.1 Bible.

Peter Stroll
  • 121
  • 7
3

Here is also a good tutorial for newbies in XSL-FO.This document gives a quick, learn-by-example introduction to XSL Formatting Objects. http://www.renderx.com/tutorial.html

Tigran
  • 61
  • 3
2

I think too that the O'Reilly book is going to be the only one, there isn't much about XSL-FO out there... Frankly I think it's a dead technology, it's just too complex for the average programmer to learn, it takes weeks - plus the good formatters out there are expensive as hell.

This is not an answer to your question, but if anyone would ask me, I'd advise against learning XSL-FO. It's a solutions searching for a problem IMO.

Roel
  • 19,338
  • 6
  • 61
  • 90
  • What would you recommend instead? – Rafael Almeida Apr 13 '16 at 19:45
  • 1
    Not sure in 2016, maybe use a PDF library and write PDF directly? I haven't dealt with this in many years. – Roel Apr 14 '16 at 09:23
  • 1
    I've been researching this for an application, and currently I still haven't found anything in the open source real for PDF generation. FOP has a new version with better XSL-FO support (out early 2016), which alleviates things a bit. There's PrinceXML, which uses HTML + CSS Paged Media, but it's closed source and expensive for most applications. Apart from some SaaS (which can still get quite expensive, but with a lower entry point), there's still little solution for more complex documents, from my current research. – Rafael Almeida Apr 14 '16 at 13:13
1

I think to be able to do xsl-fo well you need to get a solid grasp of several different technologies.

Firstly XSLT and XPath as you will be using these in the XSL-FO. There are some tools which allow you to visually create the xsl-fo but the ones I've seen are extremely expensive so I've tended to roll my own xslts as these end up much simpler than the generated xsl-fos.

Then you need a solid grasp of fop which it seems you already have but for anyone else if you are familiar with css most common stylings will be familiar to you but for the specific fop features it makes sense to do some research.

The best way to get into it is to take some basic examples amd play around with them. Here Apache FOP is a great open source processor which you can use for professional purposes if you know how to use it.

An editor like oxygen xml has in built fop support which makes it easy to quickly test your xsl-fo and should make it easier to learn xsl-fo but you can do the same thng from the command line and several other editors as well.

I'd recommend Michael Kays XSLT book as it's a great reference book for XSLT "XSLT: Programmer's Reference 2nd Edition" link

Also the FOP book by Dave Pawson is the best available XSL-FO reference book I know of although there is admittedly not much available. It's a bit out of date but it's a good reference for the core concepts and for someone starting out may make it less complex. link

His website is a great source of tips for strange issues or improving your general understanding when it comes to xsl fo. http://www.dpawson.co.uk/xsl/index.html

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Crocked
  • 1,192
  • 10
  • 10
1

http://www.w3.org/TR/xsl/

http://www.renderx.com/tools/xep.html has some good examples

http://my.safaribooksonline.com/0596003552

EthR
  • 1,924
  • 1
  • 12
  • 13
0

This might not be exactly what you need, but if you just want to have some XSL-FO test templates, you can use this transformation in Word to generate XSL-FO.

The book that I used to learn is from O'Reilly (XSL-FO), because frankly there are very little resources on the subject.

Hans Doggen
  • 1,796
  • 2
  • 16
  • 13
  • Having templates is just a desired by-product of the learning process. – Gustavo Carreno Sep 20 '08 at 18:43
  • Sometimes it helps to see the results of the transformation, as it will add most properties to the FO elements. And it is easier to follow when you want to create tables. But I must admit, I write XSL-FO templates most of the time by hand. – Hans Doggen Sep 20 '08 at 18:46