Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is XSL-FO popular?

Tags:

xml

xsl-fo

I'm going to create a converter from html to some format. I'm thinking to use intermediate format XML(XSL-FO).

My question: Why is FO format popular if not so many applications render it?

like image 791
Constantine Avatar asked Feb 28 '23 10:02

Constantine


2 Answers

I am well aware that there's a big debate going on between CSS and XSL-FO supporters, and both sides have valid and good points.

Here's the best brief argument for XSL-FO that I've seen so far:

XSL-FO provides a more sophisticated visual layout model than HTML+CSS. Formatting supported by XSL-FO, but not supported by HTML+CSS, includes right-to-left and top-to-bottom text, footnotes, margin notes, page numbers in cross-references, and more. In particular, while CSS (Cascading Style Sheets) is primarily intended for use on the Web, XSL-FO is designed for broader use. You should, for instance, be able to write an XSL style sheet that uses formatting objects to lay out an entire printed book. A different style sheet should be able to transform the same XML document into a Web site.

(Source: http://www.cafeconleche.org/books/bible2/chapters/ch18.html)

Here are some arguing XSL-FO is superior:

  • Norman Walsh's blog post

While here some say CSS is better:

  • RealObjects: CSS vs. XSL
  • Printing XML: why CSS is better than XSL-FO
like image 173
marc_s Avatar answered Mar 07 '23 09:03

marc_s


Both RenderX and Antenna House make excellent XSLFO->PDF renderers. There is also the free [Apache FOP] renderer, which is good enough for many projects. It takes a serious effort in order to fully support FO in all its gory details; perhaps the bar to entry is too high based on the size of the market, the established players, and the potential return.

Not that you asked, but before you do too much work on FO to HTML, there are a couple of free choices which might save you some effort.

  • RenderX has a set of free FO->HTML stylesheets on their website.
  • HTML2fo is available on SourceForge.
like image 32
lavinio Avatar answered Mar 07 '23 08:03

lavinio