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

Free Support Forum - aspose.com

Converting SpreadsheetML to Well formed XML / XSD data


Hello,

I have a client that is sending me a spreadsheet in SpreadsheetML format. I have to process and transform this data in BizTalk which reads well formed XML conforming to a XSD schema.

In Excel what I would do with SpreadsheetML is create a map and export/save the data as “XML Data”. In this way I get the data without the markup and I can easily validate it against my XSD schema.

How can I do this with Aspose.Cells?

DH

Hi,

Could you try to load/open the SpreadsheetML file using Aspose.Cells APIs, manipulate data(if needed), export and fill a datatable from the worksheet, put it in the DataSet and finaly use DataSet.WriteXml() .NET method to create the .xml file. I am not sure if it suits your need.

e.g..,

DataSet ds = new DataSet();
DataTable dt = new DataTable();
Workbook wb = new Aspose.Cells.Workbook();
FileStream fstream = new System.IO.FileStream(@"f:\test\MyFile.xml", System.IO.FileMode.Open);
wb.Open(fstream,FileFormatType.SpreadsheetML);
fstream.Close();
dt = wb.Worksheets[0].Cells.ExportDataTable(0, 0, wb.Worksheets[0].Cells.MaxDataRow + 1, wb.Worksheets[0].Cells.MaxDataColumn + 1);
ds.Tables.Add(dt);
ds.WriteXml("f:\\test\\myxml.xml");

Thank you.



Hello,

Thanks! That worked really well.We ill have to arrange our data but this should not be too difficult.

DH