查找 XML 地图的根元素名称
Contents
[
Hide
]
可能的使用场景
你可以通过 XmlMap.root_element_name 属性,使用 Aspose.Cells for Python via .NET 查找 XML 映射的根元素名。以下截图显示了 Microsoft Excel 中 XML 映射的根元素名。
示例代码
以下示例代码加载了 示例 Excel 文件 并访问了第一个 XML 地图,并打印了它的 XmlMap.root_element_name 属性。请参见下面给出的示例代码的控制台输出。
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
from aspose.cells import Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# Load sample Excel file having Xml Map | |
wb = Workbook("sampleRootElementNameOfXmlMap.xlsx") | |
# Access first Xml Map inside the Workbook | |
xmap = wb.worksheets.xml_maps[0] | |
# Print Root Element Name of Xml Map on Console | |
print("Root Element Name Of Xml Map: " + xmap.root_element_name) |
控制台输出
Root Element Name Of Xml Map: MiscData