CREATE(xmldoc2); Log.CALCFIELDS("Request XML"); Log."Request XML".CREATEINSTREAM(InS); xmldoc2.load(InS); xmldoc2.save('c:\xml\ins.xml'); //Temporary check to see if the xml is validThe code below works, so I know that the xml file is there. Reading the last characters and truncating, as I noticed that for some reason there are filler chars at the end
Log.CALCFIELDS("Request XML"); Log."Request XML".CREATEINSTREAM(InS); LogFilename := 'c:\xml\log.xml'; File.CREATE(LogFilename); File.CREATEOUTSTREAM(OutS); COPYSTREAM(OutS,InS); File.READ(LastChar); WHILE (LastChar[1] = 0) DO BEGIN File.SEEK(File.POS - 2); File.READ(LastChar); END; File.TRUNC; File.CLOSE; xmldoc.load(LogFilename);Realizing that there might be something wrong with the xml going into the blob I've tried checking it there, but it looks ok. The code itself recieves a node, combines it with the processing instruction and saves the result using:
Log."Request XML".CREATEOUTSTREAM(OutS); OutS.WRITE(xmldoc.xml);To make sure that ingoing xml was ok I tried saving the result (ends as a proper xml), load that file into a xmldoc and saving that into the blob. The result of the load routine is the same as saving it directly ](*,)