[XML-SIG] xml to pdf... a newbie question...

Gisbert Amm gia@webde-ag.de
Tue, 4 Mar 2003 13:06:23 +0100

> On 4 Mar 2003 at 10:43, Gisbert Amm wrote:
> > On the other hand: If you want to be flexible with future 
> output formats,
> > write out your data from Python to XML (stream or file) and 
> then transform
> > it with XSLT to the format you want.
> > 
> > There are several XSLT engines in general and for python, 
> most popular
> > perhaps Saxon (Java) and 4xslt (Python) and Xalan (C++, 
> Java) for which
> > exists a Python interface called Pyana which I use 
> currently. And FOP, as
> > you certainly know, can generate PDF from XML directly (using the
> > appropriate XSLT).
> I wouldn't call that 'direct', since you need to use full XSL rather 
> than just XSLT.
You're right, of course.

> One problem you may run into is that ReportLab has built-in so-called 
> "XML support"--meaning that it automatically interprets certain tags 
> within paragraphs as formatting instructions (<b>, <i>, and the 
> like). But it doesn't handle arbitrary elements or full XML 
> documents. I wish they hadn't added that "feature"--it's a 
> significant flaw in an otherwise excellent product. But, as I recall, 
> it's not terribly hard to work around that as long as you're aware of 
> the issue. It's been a while since I've done anything with ReportLab, 
> but I may be able to help a bit if you run into trouble.
Thank you for pointing that out and for your other interesting remarks.

Gisbert Amm