Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.Cells allows you to import the XML map inside the workbook using the Workbook.ImportXml() method. You can import XML Map using Microsoft Excel with the following 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.
The following screenshot shows how to import XML Map using Microsoft Excel.
![]() |
|---|
The following sample code shows how to use the Workbook.ImportXml() method. It generates the output Excel file as shown in this screenshot.
![]() |
|---|
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// Source directory path
U16String srcDir(u"..\\Data\\01_SourceDirectory\\");
// Output directory path
U16String outDir(u"..\\Data\\02_OutputDirectory\\");
// Create a workbook
Workbook workbook;
// URL that contains your XML data for mapping
U16String XML(u"http://www.aspose.com/docs/download/attachments/434475650/sampleXML.txt");
// Import your XML Map data starting from cell A1
workbook.ImportXml(XML, u"Sheet1", 0, 0);
// Save workbook
U16String outputPath = outDir + u"output_out.xlsx";
workbook.Save(outputPath);
std::cout << "Workbook saved successfully with imported XML data!" << std::endl;
Aspose::Cells::Cleanup();
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.