How to read XML file using FileReader javascript?
I need to get XML from a ODF file. I tried using FileReader readAsText and readAsBinaryString but its not working. FileReader readAsText returns some special characters for odf files. with readAsBinaryString var reader = new FileReader() reader.onloadend=function(e){ var data = e.target.result; //data is not in xml format var xml = str2xml(data); //getting error /* using DOM parser for xml parsing */ } reader.readAsBinaryString(file); How can get XML from ODF file using javascript FileReader? Here's a browser-based example, but this should be applicable to other JavaScript contexts: Make a