xsl-list
[Top] [All Lists]

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

2007-07-13 14:52:08
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>