Why do we need xsl-fo

Why XSL-FO?

1. Why do we need xsl-fo?
2. A comparative Feature list for XSL-FO

1.

Why do we need xsl-fo?

Ken Holman

Ednote. This came up on the list and I thought perhaps others might find it interesting.


>It seems to me that XSL-FO is an XML equivalent of Word's RTF or
>FrameMaker's MIF.

I would rather see it as a printer's HTML, not as either of those.

>I realise that
>XSL-FO is only a temporary way-station on the way to outputting to print
>via PDF, so is inherently disposable
>once you have your required output.

Right ... the same way a browser uses the HTML you've created from your XML.

>But wasn't the great promise of XML that it separated content from
>formatting?

Indeed ... your XML vocabulary is your content, XSL-FO is the paginated formatting, XSLT is the bridge.

If your formatting is browser-based instead of pagination-based, then use HTML/CSS instead of XSL-FO (which includes CSS).


>And weren't CSS and XSL designed
>to supply that formatting externally to the XML content file?

Indeed. XSLT for the rearrangement of the information, and XSL-FO for the pagination.

>Once you
>have transformed your content into an XSL-FO file,
>you have effectively eliminated all semantic tagging, so you can't modify
>the file and replicate it back to the XML original.

Indeed you cannot ... just the same as with HTML ... once you convert your XML for a web browser you've replaced <account> with <p> and <address> with <p> and you can't go from <p> back to your XML without a lot of effort (if at all).

>So why not develop CSS or XSL for print formatting?

Ummmmmm ... that's what XSL-FO is. XSLT is a spin-off off of XSL-FO. XSL is the formal name for XSL-FO, and XSLT is normatively referred to from chapter 2 of XSL.

>Why introduce a cumbersome and verbose alternative instead
>that replicates all the functionality of these formatting languages --

Which formatting languages? RTF is a proprietary word processing format with more than just layout, and Framemaker is a proprietary publishing system with more functionality that just pagination as it incorporates the equivalent of DTD, XSLT and XSL-FO. Both are proprietary and not necessarily platform dependent, one of the objectives of using markup.

>And are they not also cumbersome and verbose?
>while admittedly adding extra pagination capabilities?

XSL-FO is solely targeted to pagination. Internationally-accepted standard pagination terminology is used throughout XSL-FO for ease of use by people familiar with typography and layout. And most of the vocabulary is CSS anyway.

>CSS3 promises to add the required pagination capability,

And has promised it for a long time. XSL-FO has been in production for five years now. Commercial and non-commercial XSL-FO engines have been powering some very large and very small publishing solutions around the world in multiple languages.

>and at least one
>renderer, Prince, uses CSS2 with extensions
>for this purpose.  So can someone tell me what the justification for
>XSL-FO is?

What it was five years ago or what it is today? One could instead ask what's the justification for CSS3 to come around so much later when pagination has already been solved? It seems quite unfair to ask XSL-FO to be justified five years after it has been successful against a yet-to-be-published CSS3 standard.

Taking a look at the two, XSL-FO is a standalone vocabulary to which you transform instances of your document model into instances representing the paginated layout you require, while CSS3 decorates a document instance with pagination properties. Both models have existed for a while, users transforming their XML instances into instances of HTML for browsers, and users decorating documents structures with CSS.

So I'm guessing the designers of CSS3 wanted to maintain the document decoration approach ... does that negate the transformation model? To each his own. There are multiple data models for XML. There are multiple transformation models for XML. What's the problem?

Transforming information to HTML for a browser with browser semantics was a model before XML came around ... creating XSLT to transform XML to HTML fits that existing model ... creating XSL-FO for pagination semantics instead of browser semantics fits that model as well.

Decorating information in HTML with properties is another model and the CSS3 developers are further extending that. And they haven't finished yet. I wholeheartedly support those who wish to follow that decoration model of publishing instead of the transformation model. And they can wait until that model is complete and standardized, while those who have chosen the other model have been solving publishing problems for the last five years.

>Why would XSL-FO need justification?  Why can't both exist?
>What are the best wysiwyg editors for xsl-fo development?
>
>Having questioned the whole rationale for XSL-FO, I thought I would go for
>broke by asking the list's advice about
>suitable WYSIWYG designers or editors for developing XSL-FO stylesheets
>interactively.  It appears that XSL-FO
>is here to stay, so it is probably prudent to add the relevant skills to
>my existing publishing experience.  I figured that
>developing stylesheets via a GUI and then examining the code would get me
>up to speed faster.

It would only get you up to speed with a given vendor's idea of how to abstract the pagination into the semantics of their GUI. And that may be just fine for you. I have no comment on any vendor's choice of abstractions for their tools that assist in the creation of XSLT stylesheets for XSL-FO.

I've yet to see any vendor create the abstractions that would help me solve my customers publishing problems, so I just use XSLT. And I get to design my XSLT my way to meet my customers' business requirements regarding their development staff and practices. How would a vendor even guess what those requirements are?

Publishing needs are unique to each and every customer. What kinds of transformation are required and what nuanced layout manipulations are needed are very particular to publishing objectives.


>Can any users of WYSiWYG editors recommend those I should investigate?

I recommend you learn XSLT and get full control of XSL-FO by transforming your XML to the XSL-FO needed for your publishing solution. If you find the constraints of a given vendor's GUI doesn't interfere with that, then all power to you, but please don't judge the power of XSL-FO by measuring only a vendor's choice of how much control over XSL-FO they give to their customers.

Oh, and to boot, if you do choose to tie up your learning and your stylesheet construction solely to the choices of a given vendor's GUI, it almost becomes proprietary: what happens if the vendor goes away? How would you be able to support your stylesheets? What happens if the boss asks for something that is available in XSL-FO but isn't available in the vendor's GUI? Has XSL-FO failed you? Not at all ... the vendor has failed you.

Knowing XSLT and knowing XSL-FO gives you the platform, vendor and product independence promised by the use of markup.

I've enjoyed this holiday gift of the chance to discuss this question, but it is a tired question that perhaps some people haven't heard discussed ... I hope you weren't being malicious in trying to goad a CSS vs. XSL-FO killer fight with last one standing wins ... that is very old talk from many years ago that is water under the bridge and the world lives in harmony with the two approaches.

CSS3 would not be able to solve my customers' publishing objectives and I would not ask it to. It may very well solve other peoples' problems and they are welcome to use it.

Everyone wins.

2.

A comparative Feature list for XSL-FO

W. Eliot Kimber


> I am a template developer using 3B2 pagination software. I want to 
> know does any xslfo formatter provides such features as avialable in 
> other pagination softwares(i.e quark-express, indesign, 3B2 etc.)

> a). making round corner boxes, drawing rules.

Drawing horizontal or vertical rules can be done in several ways with FO. All the useful FO implementations also support the use of SVG to draw anything SVG can draw.

Antenna House XSL Formatter includes extensions for doing rounded box corners. These are not quite as complete as 3B2's but close.

> b). adjusting left, right, top and bottom margins.

Not sure what you mean by this. Page margins can be varied on a per-page basis by using different page masters, although they cannot be arbitrarily changed outside of the definition of a page sequence (that is, there's nothing you can put in a flow that would directly affect the page margins on a given page).

> c). auto generating footnotes.

XSL-FO has a footnote feature (automatic placement) and both XSL Formatter and XEP provide extensions for doing column footnotes (standard FO only provides full-page footnotes).

However, neither FO nor the commercial tools provide the full range of footnote placement features that 3B2 provides (especially through things like footnote control streams and rendition-time macros).

> d). placing figures and table near to their callouts in the running  
>     text.

FO has some features for this, including top and side floats (but not bottom floats unless you use footnotes (and don't have any real footnotes on that page)).

Neither FO nor any implementations provide the equivalent of 3B2's anchor control streams, which let you do very sophisticated automated placement of floats.

> e). frames with unequal column widths.

Not directly. In FO columns must be of equal width.

However, in FO 1.1 you can simulate this with multiple flows. Also, both XEP and XSL Formatter provide extensions that make it possible to achieve major/minor type layouts where the minor column only holds single-page marginalia items.

> f). colour-gradient styles.

You can use any background graphic, including gradients. You can also use inline or external SVG to do gradients (assuming your FO implementation supports SVG gradients).

> g). recto-verso style variation etc.

Yes, you can have different page masters for even and odd pages, and so on. FO 1.0 fails to provide inside/outside options for some items, but this has been corrected in FO 1.1. Both XEP and XSL Formatter provide extensions for inside/outside placement.

> Does XSL:FO fullfil such requirements in electronic typesetting.

This is always a difficult question to answer because it is highly dependent on the details of the requirements for a particular publication or class of publication.

Because XSL-FO systems tend to be so much less expensive than systems built using proprietary composition systems, the better question is often "can I reduce my requirements to the set supported by XSL-FO and its implementations in order to recognize the savings and benefits of using XSL-FO?" If the answer is "yes" then FO is the answer. If the answer is "NO" then it's not. Of course that still leaves open the question of what XSL-FO can or can't do. This is an easy question to answer in the context of specific layout sample, hard to answer generically.

That all said, FO was always targeted at the requirements of technical documentation and not high-end documents like textbooks, magazines, and the like.

In Innodata Isogen's practice as a development of publishing systems and provider of composition services, we have found that the FO standard and current FO implementations, while quite powerful and clearly appropriate for most technical documentation applications, are simply not up to the task of rendering more demanding publications such as textbooks and magazines, what I tend to refer to as "highly-designed documents".

Also, all XSL-FO implementations are geared for lights-out, batch operation. This means that there is really no opportunity for interactive modification of the rendered result the way there is in 3B2, Quark, InDesign, or XPP. While you could, in theory, generate XSL-FO instances and then tweak them, there are no user interfaces for doing this.

Also, the abstract XSL-FO processing model explicitly lacks feedback from the pagination stage back to the FO generation stage, which means that there are no features in XSL-FO for doing what FO calls "layout-driven" formatting, that is formatting that depends on knowledge of where a given object falls on a page relative to other objects. This kind of feedback can be implemented using a two-pass process, but I don't know of anyone whose done this in any general way (Ken Holman has published some work he's done to do a sort of 1/2 send pass to do index generation).

So if you have requirements that are defined in terms of where something falls in the pagination stream or in terms of how much space it takes relative to other things, then XSL-FO is probably not going to work, at least not without significant additional implementation effort.

Also, XSL-FO provides few features for automatic copyfitting, which is something that tools like 3B2 can do reasonably well. XSL Formatter provides some "make it fit" features but they are limited compared to 3B2's copyfitting features.

In the interest of full disclosure, I should mention that Innodata Isogen is currently developing and marketing a new composition offering built around what we are calling the "tool-agnostic layout system" (TALS), which uses a generic style sheet mechanism to then generate renderers that can then generate the input into different composition systems, including 3B2 and similar systems.

The style sheet mechanism is proprietary to Innodata Isogen but strongly informed by XSL-FO and intended to be a completely neutral repository of all the formatting information for a given schema-to-layout-design binding. While the style sheet design is proprietary we are treating it as though it were a standard--that is, our business intent is not to achieve propietary lock-in of our customers but to provide them with a system that has the characteristics of a standard, namely providing a neutral data format that protects them from the downstream tools as much as possible and lowers the overall cost of developing XML-based publishing systems (by reducing engineering costs, enabling practical re-use of style specifications, and automating composition with high-end composition tools as much as possible (reducing the amount of hand work needed to paginate documents).

Clients of this system own their style definitions and therefore have the right to use a different implementation (we see our secret sauce being the implementation of the renderer generators, not the style sheet language itself). As in the XSL-FO market, we should be competing on value, not trying to develop a proprietary monopoly.

We originally developed this approach in order to serve the needs of our own professional services practice--we wanted to eliminate duplication and redundancy in the development of format analysis reports and the XSLT transforms that come out of them, but quickly realized that there was a large opportunity to serve additional needs of publishers. Our orignal plan to was to generate FO renderers (that is, renderers that generate XSL-FO output, which is the bulk of what we develop in our professional services practice). However, we got early interest from publishers that were trying to get control over their use of 3B2-based composition vendors to compose publications from XML source. We realized that if we could better automate the generation of the input into tools like 3B2, we could help publishers get more control over their composition process, get more consistency in their results, and, hopefully, lower the overall cost of publishing a given title, and, possibly, reduce the time it takes to produce a publication (by significantly reducing the time required to go from manuscript to final pages).

Note that the intent of this system is absolutely *not* to compete with existing composition tools, whether XSL-FO-based or proprietary. Rather, we are trying to make it easier for clients to use different composition tools and lower the cost of getting from XML to published pages, which, we hope, will increase the market for composition tools (and, as a side effect, encourage vendors of proprietary composition systems to compete more on value (which they already do of course, but there is significant proprietary lock-in for a tool like 3B2 or InDesign or XPP once you've made the investment in skills and tools and data for using it).

In the context of XSL-FO systems, the only potential downside from our system is that we might lower the cost (both in dollars and in risk of proprietary lock in) of using high-end compositions systems to the point where they become competitive with XSL-FO-based systems where the XSL-FO system would otherwise satisfy the composition requirements. It's certainly not our intent to develop a technology disruptive to the XSL-FO market but it may be an unavoidable consequence. Of course, this might also drive the FO development community to work harder at extending the FO specification so that it is more applicable to high-end composition needs....

Our initial implementation efforts have been on generating 3B2 input, which is why I happen to know pretty much precisely how XSL-FO and its implementations relate to the specific features of 3B2.