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

Free Support Forum - aspose.cloud

Aspose.Cells to customized xml output

We tried below code from this link https://blog.conholdate.com/total/how-to-convert-excel-to-xml-in-csharp/,
Workbook workbook = new Workbook(“sample.xlsx”);
XmlSaveOptions xmlSaveOptions = new XmlSaveOptions();
workbook.Save(“data.xml”, xmlSaveOptions);

It is producing xml output as shown there.

We have custom requirement where we are expecting xml output in below format or refer attached image,

	<Student ID=1>
	<Student ID=2>
	<Student ID=3>

image.png (2.7 KB)

and my data input will look like below,
Student NAME DateOfBirth
1 Student1 10-mar-2012
2 Student2 21-mar-2012
3 Student3 15-mar-2012

Could you let us know if this is possible using Aspose.
Also If we can set the format using dynamic template then It will be more helpful.

May I ask if you are using Aspose.Cells Cloud or Aspose.Cells local components?
If you are using Aspose.Cells Cloud, you can try the Convert API or SaveAs API.
However, the current output result does not meet the output format you have proposed, so we need to evaluate it further.


You can implement your functionality with the following code:

string filename = “BookXML.xlsx”;
Workbook wb = new Workbook(InPutFloder + filename);
wb.ExportXml(wb.Worksheets.XmlMaps[0].Name, OutPutFloder + “output.xml”);

Currently, Aspose.Cells Cloud does not support this feature. If you need this feature, we will evaluate it and try to implement it as soon as possible.

Hi @wangtao,
Thank you for your quick response.
We are using Aspos.Cells local components.
I checked your code and had query in below line,
wb.ExportXml(wb.Worksheets.XmlMaps[0].Name, OutPutFloder + “output.xml”);
Could you share the input file you use to see what is inside wb.Worksheets.XmlMaps[0].Name

as you can see our first node

<Student ID=1>

has attribute ID, Could you guide us how can we set that in dynamic template?


I moved this post to https://forum.aspose.com/c/cells/9.

This topic has been moved to the related forum: https://forum.aspose.com/t/aspose-cells-to-customized-xml-output/262646