I have some XML that I'm trying to parse (using xml2js).
var xml2js = require('xml2js');
var json;
var XMLPath = './public/tsa.ibm.com/meijer/gpfs_hacmp_powersc.xml';
var rawJSON = loadXMLDoc(XMLPath);
function loadXMLDoc(filePath) {
try {
var fileData = fs.readFileSync(filePath, 'ascii');
var parser = new xml2js.Parser();
parser.parseString(fileData.substring(0, fileData.length), function(err, result) {
console.log(err);
console.log(result);
json = JSON.stringify(result);
console.log("JSON:");
console.log(JSON.stringify(result));
});
console.log("File '" + filePath + "/ was successfully read.\n");
return json;
} catch (exception) {
console.log(exception);
}
}
[Error: Invalid character in entity name Line: 44 Column: 123 Char: =]
On that line, the code is: <value xs:nil="true" />
I'm not sure what's going on here. :( Could anyone please help? I haven't really tried anything. I'm not sure what to even try.
Thanks for the help!