Codesample for xml/xslt transforming

Jeremy Jones zanesdad at
Tue Sep 9 16:27:41 CEST 2003

* Axel Straschil (axel at wrote:


> I've test.xml, test.xsl or two vars with the code
> and wan't to transform it. 
> Google just helped me for C ...

This code used to work (kinda ugly, though - sorry):

            from Ft.Xml.Xslt.Processor import Processor
            import Ft.Xml.InputSource 
            ##I was working with a DOM object here
            xml_data = dom.toxml()
            processor = Processor()
            f = open("rmkr.xsl",'r')
            xsl_data =
            processor.appendStylesheet(Ft.Xml.InputSource.DefaultFactory.fromString(xsl_data, "uri"))
            result =, "uri"))
            result_html = os.path.join(result_dir, "%s.html" % outfile_prefix)
            htmlfile = open(result_html, "w")

I haven't tested it recently to see if it still works.  It worked with FT under Python 2.1.

Jeremy Jones

More information about the Python-list mailing list