Loading xml files through node.js on windows

Weemethorgo

New Member
I'm trying to load and parse a local XML file through Node.js hosted in IIS.I used fs readFile to read the string and the xmldom module to parse it.It works until file size is small (few kb), but if I try to load a 3Mb xml it fails.Which other xml modulefor windows could perform better? This is my code\[code\]var fs = require('fs');fs.readFile('C:\\Temp\\TEST.xml', 'ascii', function(err,data){ if(err) { console.log("Could not open file"+ err); process.exit(1); } var Dom = require('xmldom').DOMParser; var doc = new Dom().parseFromString(data.substring(2,data.lenght)); console.log(doc.childNodes[0].localName);});\[/code\]After 5 min the xml the parser is still running, while on a simpler example it works. i saved the output from msinfo32 in xml formatAfter 10 mins output is RangeError: Maximum call stack size exceededoutput is generated from "msinfo32 /nfo C:\TEMP\TEST.NFO"
 
Back
Top