Find the Root Element Name of XML Map with C++

Possible Usage Scenarios

You can find the Root Element Name of XML Map using Aspose.Cells with the XmlMap.GetRootElementName() property. The following screenshot shows the root element name of the XML Map in Microsoft Excel.

todo:image_alt_text

Sample Code

The following sample code loads the sample Excel file, accesses the first XML Map, and prints its root element name using the XmlMap.GetRootElementName() property. Please see the console output of the sample code given below.

#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;

int main()
{
    Aspose::Cells::Startup();

    // For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C

    // Source directory path
    U16String srcDir(u"..\\Data\\01_SourceDirectory\\");

    // Path of input excel file
    U16String inputFilePath = srcDir + u"sampleRootElementNameOfXmlMap.xlsx";

    // Load sample Excel file containing an XML Map
    Workbook wb(inputFilePath);

    // Access the first XML Map in the workbook
    XmlMap xmap = wb.GetWorksheets().GetXmlMaps().Get(0);

    // Print the root element name of the XML Map to the console
    std::cout << "Root Element Name Of Xml Map: " << xmap.GetRootElementName().ToUtf8() << std::endl;

    Aspose::Cells::Cleanup();
}

Console Output

Root Element Name Of Xml Map: MiscData