I download a XML file from the server using a XML Object. My task is to display that object inside a downloaded file. This is my achievement until now:
My code runs inside the read operation success callback. This is working:
var string = "abs";
var fileName = "docxml";
var uri = 'data:text/xml;charset=utf-8,'+ encodeURI(string);
var link = document.createElement("a");
link.href = uri;
link.style = "visibility:hidden";
link.download = fileName + ".xml";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
If I build the URI this way it is not working.
var uri = 'data:text/xml;charset=utf-8,'+ encodeURI(oData.results[0].xmlmessage);
How can I access the XML content of an object?