我如何编辑 XML 文件xml2js
const fs = require('fs');
const xml2js = require('xml2js');
var fn = 'file.xml';
fs.readFile(fn, function(err, data) {
parser.parseString(data, function(err, result) {
//result.data[3].removeChild(); ?????
//result.date[2].name.innerText = 'Raya'; ?????
});
});
这是行不通的!