Reputation: 16367
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?
Upvotes: 3
Views: 1120
Reputation: 898
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.
Upvotes: 5