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

Possible Usage Scenarios

Aspose.Cells provides XmlMapCollection.add(string) method which you can use to import your XML Map inside the workbook.

Add XML Map inside the Workbook using XmlMapCollection.Add method

The following sample code adds XML Map inside the workbook using the XmlMapCollection.add(string) method and saves it as output excel file. The screenshot shows the XML Map that has been imported from the sample.xml inside 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 found inside the sample.xml inside 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"));