تصدير بيانات XML المرتبطة بخريطة XML داخل المصنف
Contents
[
Hide
]
تصدير بيانات XML المرتبطة بخريطة XML داخل المصنف
الرجاء استخدامWorkbook.ExportXml () طريقة لتصدير بيانات XML المرتبطة بخرائط XML الخاصة بك داخل المصنف الخاص بك. يقوم نموذج التعليمات البرمجية التالي بتصدير بيانات XML الخاصة بكافة خرائط XML من المصنف واحدًا تلو الآخر. رجاء تاكد مننموذج ملف اكسل المستخدمة في هذا الرمز وتصدير بيانات XML من خريطة XML الأولى.
This file contains 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-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Create directory if it is not already present. | |
bool IsExists = System.IO.Directory.Exists(dataDir); | |
if (!IsExists) | |
System.IO.Directory.CreateDirectory(dataDir); | |
// Instantiating a Workbook object. | |
Workbook workbook = new Workbook(dataDir + "sample.xlsx"); | |
// Export all XML data from all XML Maps from the Workbook. | |
for (int i = 0; i < workbook.Worksheets.XmlMaps.Count; i++) | |
{ | |
// Access the XML Map. | |
XmlMap map = workbook.Worksheets.XmlMaps[i]; | |
// Exports its XML Data to file. | |
workbook.ExportXml(map.Name, dataDir + map.Name + ".xml"); | |
} |