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

Free Support Forum - aspose.com

How to Convert xml file to Xls format in java

How to Convert xml file to Xls format in java

Hi Mahalakshmi,


Thank you for contacting Aspose support.

First of all, please note that Aspose.Cells APIs cannot load all XML data files. The XML structure should correspond to SpreadsheetML format if you wish to import it in Aspose.Cells object model for any type of manipulation. I have attached a simple SpreadsheetML sample with this post for your reference.

Regarding your sample, it does not correspond to SpreadsheetML format therefore Aspose.Cells APIs cannot load it. However, if the format is correct, you can use the following piece of code to load and convert the file to XLS file format.

Java

LoadOptions options = new LoadOptions(LoadFormat.SPREADSHEET_ML);
Workbook book = new Workbook(dir + “60314810046.xml”, options);
book.save(dir + “output.xls”, SaveFormat.EXCEL_97_TO_2003);