Re: [xsl] XSL-FO plain text processor?

Subject: Re: [xsl] XSL-FO plain text processor?
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Fri, 13 Jul 2007 23:51:51 +0200
Kai Hackemesser wrote:
I'm looking for a solution to create a formatted plain text file from XML. Currently I try apache FOP Processor with XSL-FO input. but I can't get it looking as I want, I always have misformations, missing or to much spaces or empty rows, even clipped characters. I would like to know if you know any alternatives to that?

The FOP text renderer tries to snap the characters to a fixed grid, defined by hard-coded lines-per-inch (8) and chars-per-inch (16.67) constants. Obviously, this will only work for a fixed font (e.g. courier), a certain line-height and an appropriate font-size. 8 LPI translate to an line-height of 0.125in, which should be set explicitly. The font size should be a little smaller and hopefully match the CPI, you should try a setting around 8pt (I'm too lazy to check the Courier metrics right now, it's bed time).

Alternatives to using XSLFO are using XSLT to convert the XML into
text directly as already mentioned, which is a bit tedious in case
of tables and right justified text, and using XSLT to convert to
nroff source and let nroff/groff do the grunt work.
Someone mentioned http://sourceforge.net/projects/xml2txt/

J.Pietschmann

Current Thread