from saxonche import * def makehtml(infile,thexsl,outfile): with PySaxonProcessor(license=False) as proc: xsltproc = proc.new_xslt30_processor() with open(infile,"r") as thefile: document = proc.parse_xml(xml_text=thefile.read()) theexecutable = xsltproc.compile_stylesheet(stylesheet_file=thexsl) theoutput = theexecutable.transform_to_string(xdm_node=document) with open(outfile,"w") as thehtml: thehtml.write(theoutput)