Add XML Map inside the Workbook using XmlMapCollection.Add method with Node.js via C++

Possible Usage Scenarios

Aspose.Cells provides the XmlMapCollection.add(string) method, which you can use to import an XML map into a workbook.

Add XML Map inside the Workbook using XmlMapCollection.Add method

The following sample code adds an XML map into the workbook using the XmlMapCollection.add(string) method and saves it as an output Excel file (output.xlsx). The screenshot shows the XML map that has been imported from sample.xml into the output Excel file.

add-xml-map

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");

// Create workbook object
const wb = new AsposeCells.Workbook();

// Add XML map from sample.xml into the workbook
wb.getWorksheets().getXmlMaps().add(path.join(dataDir, "sample.xml"));

// Save the workbook in XLSX format
wb.save(path.join(dataDir, "output_out.xlsx"));