XmlMapCollection.Addメソッドを使用してワークブックにXML Mapを追加する

可能な使用シナリオ

Aspose.CellsはXMLマップをブック内にインポートするために使用できるXmlMapCollection.Add()メソッドを提供します。

XmlMapCollection.Addメソッドを使用してワークブックにXML Mapを追加する

以下のサンプルコードは、output excel fileとして保存されるサンプル.xmlからインポートされたXMLマップをブック内に追加するXmlMapCollection.Add()メソッドを使用しています。

add-xml-map

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Create workbook object
Workbook wb = new Workbook();
// Add xml map found inside the sample.xml inside the workbook
wb.Worksheets.XmlMaps.Add(dataDir + "sample.xml");
// Save the workbook in xlsx format
wb.Save(dataDir + "output_out.xlsx");