I've been using XSLT+CSS to render XHTML to PDF using Antenna House Formatter.
I presented on my experience with using CSS for pagination at the DITA Europe
conference:
https://www.slideshare.net/drmacro/using-css-paging-to-render-dita-documents
tl;dr:
The cost advantages of CSS are so compelling that they outweigh the limitations
in layout functionality (which can be compensated for either through source
preprocessing or the use of formatter-specific extensions) and the current poor
state of CSS pagination how-to information (basically the specs are
impenetrable and there is no CSS pagination book or even web site that I've
found).
As Liam says, CSS is not as complete as XSL-FO in terms of its layout features.
In addition, the specs are still under development and many important aspects
are underspecified.
However, CSS is so much easier to work with and is so much more accepted that
the cost in functionality and spec fuzziness is far outweighed by the ability
to use less-specialized personnel to do the styling work.
Basically, if I never have to generate XSL-FO again I will be very happy (and I
was one of the first power users of XSL-FO and a contributor to the spec).
CSS+XSLT provides a better separation of concerns between the styling concern
and the data transformation concern. The result is that the XSLT required to
prepare the source content for styling is much simpler than the equivalent
XSLT-ot-FO transform would be and it is easier to create and maintain the CSS.
For example, a web designer familiar with CSS for browser delivery could easily
learn the addition pagination stuff and then do most or all of the pagination
design using their normal development tools. The main challenge I ran into was
the fact that browsers don't implement or even necessarily recognize pagination
features in CSS, so you can't preview everything in a browser, but you can
certainly verify all the content formatting aspects. You still need to use your
PDF renderer to test and validate the pagination aspects.
Coordination is still required between the XSLT and the CSS but it can be at
the level of hierarchical structures, tag names, and class names, rather than
low-level details of how the FO should be structured.
Another potential advantage is that the same CSS can be shared between PDF and
browser delivery, making it easier to create and maintain consistent
presentation for publications delivered in both PDF and HTML to browsers. At
least in the DITA world today, using the main open-source tool (DITA Open
Toolkit), the PDF tool chain and styling definition is completely separate from
the HTML generation and styling, making it more expensive than it needs to be
to keep the two styles in sync.
For my project (which is non-DITA) and for most DITA projects it will be
necessary to use extensions to the base CSS functionality. Antenna House
Formatter definitely has these (basically everything it can do for XSL-FO it
can for CSS through one kind of extension or another). Prince and Vivliostyle
also have similar extensions.
For my project, which involves producing "change pages" I had to also do XSLT
post-processing of the AHF-generated area tree, which is a literal XML
representation of the formatted pages. This allowed me to implement a
multi-pass process that gives subsequent passes access to details about the
pagination of the source (for example, I capture the mapping from source
elements with IDs to the pages they produce). I was also able to do tricks with
IDs and empty elements in order to inject information into the area tree needed
to support my point-page post processing. I would have had to do something
similar with an XSL-FO-based solution, so here the use of CSS is not really
germain, just pointing out that when your rendering tools support it you have
the opportunity to do a lot.
Cheers,
E.
--
Eliot Kimber
http://contrext.com
From: "Vasu Chakkera vasucv(_at_)gmail(_dot_)com"
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com>
Reply-To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Date: Wednesday, January 17, 2018 at 6:30 PM
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject: [xsl] Prince XML vs Docbook
I came across a tool called Prince XML , which apparently works on Jason/XML
and converts it to PDF or HTML or any format using CSS .
I did not work on the publishing area for a while, but the last time I did, we
were working with docbook , DITA, topics and applying XSLTs on the XMLS to
generate XSL:FO documents for PDFs and XSLTs for HTMLS .. are there any good
arguments for one or the other ?
Are people still using the good old docbook XSLTs ? Any pros and cons for the
Prince XML vs XSL:FO? Or am I comparing two totally different things?
Vasu Chakkera
EasyUnsubscribe (by email)
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--