导出链接到工作簿内的 XML 映射的 XML 数据
Contents
[
Hide
]
导出链接到工作簿内的 XML 映射的 XML 数据
请使用 Workbook.exportXml() 方法导出链接到工作簿中的 XML 映射的 XML 数据。下面的示例代码将工作簿中所有XML Maps的Xml数据一一导出。请检查示例 excel 文件在此代码中使用和导出第一个 XML Map 的 XML 数据.
Java 导出链接到工作簿内 XML 映射的 XML 数据的代码
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(ExportXmlDataOfXmlMap.class) + "articles/"; | |
//Load source workbook | |
Workbook wb = new Workbook(dataDir + "sample_Export-Xml-Data-linked.xlsx"); | |
//Export all XML data from all XML Maps inside the Workbook | |
for (int i = 0; i < wb.getWorksheets().getXmlMaps().getCount(); i++) | |
{ | |
//Access the XML Map | |
XmlMap map = wb.getWorksheets().getXmlMaps().get(i); | |
//Exports its XML Data | |
wb.exportXml(map.getName(), dataDir + map.getName() + ".xml"); | |
} |