I recommend you don't build XSL:FO through Java code directly. Produce a simple XML format with just the data in it. Use a XSLT stylesheet afterwards to convert the XMl to XSL:FO. It sounds like a lot of work, but you're actually going to save time. For example, if your layout has to change you have to adjust your Java code, recompile, redeploy. If you're working with XSLT you can use some external XML tool, and you just have to switch the stylesheet if something changes in the layout.
The whole idea about XSL (XSLT+XSL:FO) is separation of data/layout. You will be a lot more flexible that way! Just imagine you want to generate HTML or SVG instead of XSL:FO. This way, you (only) have to switch stylesheets. Your way means writing the Java classes that produce the XML all over again. > This is not exactly what I mean. I don't have XML data documens, I'm trying > to build a pure XSL:FO document through code, not transform an existing XML > to FO. It will go like this: > Data (from DB) --(Java code)--> FO document --(render with FOP)--> PDF > > Any clue? > > -----Original Message----- > From: Katiyar, Bhawana [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 30, 2002 5:05 PM > To: [EMAIL PROTECTED] > Subject: RE: Building a FO document with FOP > > > I guess it is better to build them as XML documents and use xsl:fo to > transform them to FO documents. It is much easier. You could use the XML to > render HTML, RTF or any other format. FOP programming is also much easier, > as you shift all the java programming burden of building the FO document to > FOP. > Bhawana > > -----Original Message----- > From: Ismaeil, Sameh Z [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 30, 2002 10:37 AM > To: '[EMAIL PROTECTED]' > Subject: Building a FO document with FOP > > > Hello All, > > We are trying to build FO documents through Java code, these documents will > be rendered with FOP. I would like to know whether it is recommended to > build them using the FOP classes that represent FO elements (FONode/FObj and > its decendants), or whether it is better to build them as XML docuemnts and > use FOP for rendering only. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch