[XML-SIG] using xslt with python

Daniel Veillard veillard at redhat.com
Mon Jun 16 06:56:34 EDT 2003


On Sat, Jun 14, 2003 at 01:05:08AM -0400, Paul Tremblay wrote:
> The second link did the trick. Apparently, I already had the bindings
> module installed:
[...]
> How di the binding get in my site-packages? Are they installed with
> PyXml? Or do you think Mandrake linux might have put them there?

  yes, module libxml2-python and libxslt-python

> Last, what is the advantage to using the above code as opposed to using:
> 
> file_handle = os.popen('xsltproc xsl_file, xml_file)

  performances mostly, your application doesn't have to fork(), exec()
then reload all the shared libraries to then run the transformation.
Also using the python module you get the tree directly you don't
have to reparse it if you're interested in the result tree and not the
serailization of the result.

> If you claim that xsltproc ports to Windows, it seems the os.popen
> option would almost be simpler.

  definitely

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



More information about the XML-SIG mailing list