I have a directory that contains
--index.html
--script.js
--file.xml
and I want to read the content of the file.xml as a string in order to replace a few words within the xml-file. (Later on I would like to send the edited xml-file as e-mail).
I managed to access to xml-file, but did not manage to save the whole content in a string and/or replace some known keywords within the xml.
This is where I got so far:
var oXHR = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
function reportStatus2() {
if (oXHR.readyState == 4) // REQUEST COMPLETED.
console.log(this.responseXML) // This gets me the XML-document, but I want the complete xml content as string
}
oXHR.onreadystatechange = reportStatus2;
oXHR.open("GET", "../file.xml", true);
oXHR.send();
I found so many posts on that topic here, but none was able to answer my question!
Any ideas?