I'm not sure I understand the question fully, but are you expecting pisa to apply the xslt transformation? I don't think it will do that (you might want to look at lxml and use that to apply the xslt before converting to pdf with pisa)
Answer from Steven on Stack OverflowConvert xml to pdf in Python - Stack Overflow
How do I convert XML to HTML in python? - Stack Overflow
¿Is there an easy (and free) way of converting '.xml' files to '.pdf'? (using python, of course)
Converting pdf files to text or xml files without losing format
Videos
» pip install pyxml2pdf
One way to achieve this is to use XSLT Transformation. Most programming languages including Python will have support to convert an XML document into another document (e.g. HTML) when supplied with an XSL.
A good tutorial on XSLT Transformation can be found here
Use of Python to achieve transformation (once an XSL is prepared) is described here
There are several things wrong with your XHTML source. First, xmlns is not a correct attribute for the xml declaration; it should be put on the root element instead. And the root element for XHTML is <html>, not <xhtml>. So the valid XHTML input in this particular case would be
<?xml version=\"1.0\"?>\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head><title></title></head>\n<body>\n</body></html>
That said, I'm not sure if xml.etree.ElementTree accepts that, having no experience with it.
I need a free tool that can convert from '.xml' to '.pdf', the reason because I ask for a python-solution is that I need to use that in another python script/program in order to automate the process.
What I am trying to do is to create a program/script that "monitors" a certain folder and converts all '.xml' files to PDF. There will be a constant 'stream' of '.xml' files towards that folder.
I have very little experience programming (only in python) but I know/understand the basics.
Thanks,
Krakatok