XmlMapCollection.Add メソッドを使用して、ワークブック内に XML マップを追加します。
Contents
[
Hide
]
考えられる使用シナリオ
Aspose.Cells提供XmlMapCollection.Add() メソッドを使用して、ワークブック内に XML マップをインポートできます。
XmlMapCollection.Add メソッドを使用して、ワークブック内に XML マップを追加します。
次のサンプル コードは、XML マップをワークブック内に追加します。XmlMapCollection.Add() メソッドとして保存します。出力エクセルファイル .スクリーンショットは、からインポートされた XML マップを示しています。サンプル.xml出力Excelファイル内。
サンプルコード
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(AddXMLMapInsideWorkbook.class) + "articles/"; | |
// Create workbook object | |
Workbook wb = new Workbook(); | |
// Add xml map found inside the sample.xml inside the workbook | |
wb.getWorksheets().getXmlMaps().add(dataDir + "sample.xml"); | |
// Save the workbook in xlsx format | |
wb.save(dataDir + "AddXMLMapInsideWorkbook_out.xlsx"); |