Open prasad83 opened 9 years ago
parser.addListener: end and error both trigger callback if there is trouble with xml.
parser.addListener('end', function(jsonDOM) { if (jsonDOM) { //... if (callback) callback(null, output); } else { if (callback) callback("failed to parse xml", null); } } parser.addListener("error", function(err) { // ... callback = null; });
+1
parser.addListener: end and error both trigger callback if there is trouble with xml.