[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSL-FO plain text processor?

Subject: Re: XSL-FO plain text processor?
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Fri, 13 Jul 2007 23:51:51 +0200
Re:  XSL-FO plain text processor?
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.