We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Words 22.5 no longer renders XML files!

Files starting with <?xml version="1.0"?>
are no longer rendered by Aspose.Words 22.5. Why?
In 22.4 this code was working fine. For input file use any xml.

var doc = new Document(inputFile)
var saveOptions = new PdfSaveOptions
	PageSet = new PageSet(new PageRange(0, doc.PageCount))
doc.Save(outputFile, saveOptions);

In the release notes I saw some changes for XML files. Should I change my code?

Best Regards,

@DWProject Could you please attach your input XML document here for testing? We will check the issue and provide you more information.

sure here it is.sample Xml.zip (286 Bytes)

@DWProject In earlier versions Aspose.Words detected such files as TXT, in the current version, Aspose.Words mimics MS Word behavior upon loading XML files.
You can force Aspose.Words to consider the file as TXT:

LoadOptions opt = new LoadOptions();
opt.LoadFormat = LoadFormat.Text;
Document doc = new Document(@"C:\Temp\in.xml", opt);

Great! Thanks a lot for the fast responce!

1 Like