2010/2/28 Stefan Behnel <span dir="ltr"><<a href="mailto:stefan_ml@behnel.de">stefan_ml@behnel.de</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Roland Mueller, 28.02.2010 13:01:<br>
<div class="im">> The stylesheet is test.xsl and the insput data test.xml. The following<br>
> Python code the applies the stylesheet on the input data and puts the output<br>
> into foo.<br>
><br>
> Python code:<br>
> #!/usr/bin/python<br>
> import sys<br>
> import libxml2<br>
> import libxslt<br>
><br>
> styledoc = libxml2.parseFile("test.xsl")<br>
> style = libxslt.parseStylesheetDoc(styledoc)<br>
> doc = libxml2.parseFile("test.xml")<br>
> result = style.applyStylesheet(doc, None)<br>
> style.saveResultToFilename("foo", result, 0)<br>
><br>
> BR,<br>
> Roland<br>
><br>
> *Example run in Linux:*<br>
> roland@komputer:~/Desktop/XML/XSLT$ ./xslt_test.py<br>
<br>
</div>Note that the shorthand for the above is<br>
<br>
    $ xsltproc test.xsl test.xml > foo<br>
<div><div></div><div class="h5"><br></div></div></blockquote><div>yes, that's true, and probably the best way to use XML stylesheets in Linux. <br><br>However, this is a Python ML, and so I was sending the Python example. The original poster does not necessarily use Linux, and I do not know about Windos tools in that regard.<br>
<br>BR,<br>Roland <br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div class="h5">
Stefan<br>
<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>