At 10:32 AM 2/1/02 -0600, you wrote:
>step to use XSL:FO to generate PDF since we already had XML being generated.
>One of the real blessings of this approach is our clients can customize the
>look and feel of the application by changing the XSL files without our ever
>opening a Java source file.

We also have a web based service here, and currently are using the same 
approach as you are, but the problems we encouter are the following:

If you generate XSL:FO from XML, the XSLT(stylesheet) can become very 
complicated, at least for us because:

We generate a lot of tables, and they are quite different what concerns the 
formatting/color. That means, there has to be a section in the XSLT for 
each type of table and complicated if-then-else decisions to decide which 
formatting to apply and how. Take into account also, that up to now you 
have to manually code in the column width of each column in every table for 
FOP, this is a nightmare! In other words, changing the XSLT is much, much, 
much more painfull than changing a java source file(supposing the use of 
iText).

An alternative for having a simpler XSLT, would be to encode most of the 
formatting in the XML, but then you would have XML with formatting 
information, and if you want to change the look and feel you have to change 
the java source that is generating the XML.

I think the use of XSLT is only usefull if you have a standardized look and 
feel, like every table looks the same way, etc... But even then, if 
you  decide that you need a new table it is very difficult to define a new 
formatting using XSLT to generate XSL:FO. XSL:FO is a complicated language, 
and the complexity transfers to the generating XSLT(which is cumbersome 
enough on its own), which looks like a big messy thing here at the company. 
Our XSLT files are currently VERY long and MESSY. It would be much simpler 
to code the same thing in Java, take a look at the iText page and their 
examples(http://www.lowagie.com/iText/).

And if you still need your XML, you can take this approach:

1. Generate XML from Java for whatever you need.
2. Generate the PDF from Java using iText.

I think this is probably the approach we are gonna take here...
And if you code smartly you can arrange is to also not have to change the 
java source for a change of look and feel. Just store the formatting 
information in a '.properties' file like:

tableBackGroundColor=red
tableFont=Roman8
etc...

Then you can change the look and fell by just editing that properties file...

I will nail down the weaknesses of the XML->PDF approach:

1. XSL:FO is a very complicated and messy language
2. XSLT is also kinda complicated to use, at least if you have to do 
complicated formatting...

Best regards...Roland


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to