Question

In my Python app, I have an XML document that I'd like to transform using my XSL file. I'm currently using xml.etree to generate the XML document, but I haven't found anything within Python 2.5 that will allow me to natively transform my XML document.

I've already found one library (libxslt) which can execute the transformation, but I figured Python would have a native library that achieves the desired result.

Any thoughts?

Was it helpful?

Solution

There is no XSLT processor in Python 2.5.

OTHER TIPS

If you have libxml2 and libxslt installed, then also install lxml. It provides a nice, easy-to-use binding for libxml2 and libxslt, and it also implements the ElementTree API.

libxml2/libxslt also come with their own, much lower-level Python bindings, but lxml is much more straightforward and pythonic, and it seems to have great performance as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top