TODO: Write an xxl file to convert Crystal Reports to Jasper Reports.
import os import subprocess import glob from pathlib import Path root_dir = r"C:\crystalxml" xslFile = r"C:\Saxon\pretty.xsl" for filename in glob.iglob(root_dir + '/**/*.xml', recursive=True): my_parts = filename.split("\\") justname = my_parts[-1].split('.')[0] my_dir = os.path.dirname(filename) newname = fr'{my_dir}\{justname}.html' cmd = fr'java -cp C:\Saxon\saxon-he-10.1.jar net.sf.saxon.Transform -t -s:"{filename}" -xsl:{xslFile} -o:"{newname}"' subprocess.call(cmd)