strange error when calling transform_to_file in a loop
I need to run a sequence of transforms, one after another, each one operating on the output of the preceding one. Here's the code I am currently trying:
with saxonc.PySaxonProcessor(license=False) as proc: print(proc.version) # Initialize the XSLT 3.0. processor xsltproc = proc.new_xslt30_processor() for i in (0,1,2,3,4) : print(i) SCRIPT=scriptRoot+"pt"+str(i)+".xsl" TEMP=tempRoot+"temp-"+str(i+1)+".xml" print("Running "+SCRIPT+" on "+FILE+" producing "+TEMP) xsltproc.transform_to_file(source_file=FILE, stylesheet_file=SCRIPT, output_file=TEMP) FILE=TEMP
First time round the loop this behaves as expected. But then I get an I/O error on the output file I am trying to create?!
SaxonC-HE 11.3 from Saxonica 0 Running /home/lou/Public/pdf2tei/pt0.xsl on /home/lou/Desktop/LacyWork/outgoing/0101Time/temp.xml producing /home/lou/Desktop/LacyWork/outgoing/0101Time/temp/temp-1.xml 1 Running /home/lou/Public/pdf2tei/pt1.xsl on /home/lou/Desktop/LacyWork/outgoing/0101Time/temp/temp-1.xml producing /home/lou/Desktop/LacyWork/outgoing/0101Time/temp/temp-2.xml Error I/O error reported by XML parser processing /home/lou/Desktop/LacyWork/outgoing/0101Time/temp/temp-2.xml: No such file or directory. Caused by java.io.FileNotFoundException: No such file or directory
Please register to edit this issue