Çalışma kitabı içinde bağlı XML Haritasına XML Verisi İhraç Edin Node.js ile C++

Çalışma Kitabı içinde XML Haritasına bağlı XML Verilerini Dışa Aktar

Lütfen çalışma kitabınızdaki XML Haritalarınıza bağlı XML verisini ihraç etmek için Workbook.exportXml() yöntemini kullanın. Aşağıdaki örnek kod, çalışma kitabındaki tüm XML Haritalarını tek tek ihraç eder. Bu kodda kullanılan örnek excel dosyasını ve birinci XML Haritasının ihraç edilen XML verisini kontrol edin.

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");

// Instantiating a Workbook object.
const workbook = new AsposeCells.Workbook(path.join(dataDir, "sample.xlsx"));

// Export all XML data from all XML Maps from the Workbook.
for (let i = 0; i < workbook.getWorksheets().getXmlMaps().getCount(); i++) {
// Access the XML Map.
const map = workbook.getWorksheets().getXmlMaps().get(i);

// Exports its XML Data to file.
workbook.exportXml(map.getName(), path.join(dataDir, `${map.getName()}.xml`));
}