使用 C++ 在 Workbook 中添加 XML 映射 XmlMapCollection.Add 方法
Contents
[
Hide
]
可能的使用场景
Aspose.Cells 提供了 XmlMapCollection.add(string) 方法,您可以使用该方法将 XML 映射导入工作簿。
使用XmlMapCollection.Add方法在工作簿中添加XML映射
以下示例代码使用 XmlMapCollection.add(string) 方法向工作簿中添加 XML 映射,并将其保存为 输出 Excel 文件。屏幕截图显示了已从 sample.xml 中导入的 XML 映射。
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"));