Import XML Map inside a Workbook using Aspose.Cells
Contents
[
Hide
]
Aspose.Cells allows you to import XML map inside the workbook using the Workbook.importXml() method. You can import XML Map using the Microsoft Excel with the following steps
- Select Developer tab
- Click Import in the XML section and follow the required steps.
You will need to provide your XML data to complete the import. Here is a sample XML data that you can use for testing.
Import XML Map using Microsoft Excel
The following screenshot shows how to import XML Map using Microsoft Excel.
Import XML Map using Aspose.Cells
The following sample code shows how to make use of Workbook.importXml(). It generates the output excel file as shown in this screenshot.
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 | |
String dataDir = Utils.getDataDir(ImportXMLMap.class); | |
// Create a workbook | |
Workbook workbook = new Workbook(); | |
// URL that contains your XML data for mapping | |
String XML = "http://www.aspose.com/docs/download/attachments/434475650/sampleXML.txt"; | |
// Import your XML Map data starting from cell A1 | |
workbook.importXml(XML, "Sheet1", 0, 0); | |
// Save workbook | |
workbook.save(dataDir + "output.xlsx"); |