The following points will be covered in this article:
- Convert Excel to XML in Node.js
- Excel to XML conversion - advanced options
The installation process of this library is easy and you can jump to the installation section in case of difficulty. There are two ways to enable this API in your project.
First, you can run the following commands to install it:
npm install java npm install aspose.cells
The other way is to download the API package and enable this library in your Node.js project.
Convert Excel to XML in Node.js
This library is so powerful and robust due to its enterprise-level features.
You may follow the steps and the code snippet below:
- Create an object of the Workbook class and load the source Excel file.
- Instantiate an instance of the XmlSaveOptions() class that will be used to save a file in XML file format.
- Invoke the save method to save the file.
You can see the output in the image below:
Excel to XML conversion - advanced options
Following are the steps and the code snippet:
- Instantiate an object of the Workbook class and load the source Excel file.
- Create an instance of the XmlSaveOptions class that will be used to save a file in XML file format.
- Call the setClearData method that makes the workbook empty after saving the file.
- If the value of setCreateDirectory is true, the directory will be automatically created before saving the file.
- setCachedFileFolder method is used to store some extensive data.
- Call the save method to save the file.
Get a Free License
You can get a free temporary license to try the API beyond evaluation limitations.
Ask a question
You can let us know about your questions or queries on our forum.
How do I get Excel data into XML?
How do I convert XLSX to XML?
You can check this XmlSaveOptions class to convert XLSX files to XML files programmatically. Further, you can see the list of methods here.