Import XML to Excel workbook with Node.js via C++
Aspose.Cells allows you to import the XML map inside the workbook using the Workbook.importXml(string, string, number, number) method. You can import XML Map using Microsoft Excel with the following steps:
- Select Developer tab
- Click Import in the XML section and follow the required steps.
You will need to provide your XML data to complete the import. Here is a sample XML data that you can use for testing.
Import XML Map using Microsoft Excel
The following screenshot shows how to import XML Map using Microsoft Excel.
![]() |
---|
Import XML Map using Aspose.Cells for Node.js via C++
The following sample code shows how to make use of the Workbook.importXml(string, string, number, number). It generates the output excel file as shown in this screenshot.
![]() |
---|
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
// Create a workbook
const workbook = new AsposeCells.Workbook();
// Local XML file path
const XML = path.join(dataDir, "sampleXML.txt");
// Import your XML Map data starting from cell A1
workbook.importXml(XML, "Sheet1", 0, 0);
// Save workbook
workbook.save(path.join(dataDir, "output_out.xlsx"));