[XML-SIG] using xslt with python

Daniel Veillard veillard at redhat.com
Thu Jun 12 20:40:26 EDT 2003

On Thu, Jun 12, 2003 at 06:02:35PM -0400, Paul Tremblay wrote:
> command = 'xsltproc --param indent-amount %s %s %s > %s' % \
>                 (indent_amount, xsl_file, file, output)
>         os.system(command)
> This only works on unix, and it only works if the user has xsltproc. I
> want to make the script useable for different platforms, and ideally for
> different xslt processors. For example, if the user wants to use xalan,
> then the script uses xalan to process the document.

  You can make it work on Windows, and Unix by making sure your have
libxml2 and libxslt python bindings installed too and using them without
doing an exec. See http://xmlsoft.org/python.html and 
http://xmlsoft.org/XSLT/python.html .

  BTW xsltproc is ported to Windows, I don't see why this code would
not work...


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