I've been trying to figure this out for several hours now to no avail. In javascript, I have string of XML that I've created:
var txt="<bookstore><book type='cooking'>";
txt+="<title>Everyday Italian</title>";
txt+="<author>Giada De Laurentiis</author>";
txt+="<year>2005</year>";
txt+="</book>";
I've then used this to create the XML dom:
if (window.DOMParser) {
var parser=new DOMParser();
var xmlDoc=parser.parseFromString(txt,"text/xml");
}
else{ // Internet Explorer
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.loadXML(txt);
}
I need to send the xmlDoc to a server page (an asp page I think) where the server will prompt me to save the xml file to my local drive. I don't have too much experience with this, and have hit a road block. I know that I need to create an XMLHttpRequest and post my xmlDoc to an asp page:
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST", "http://MYSERVERURL/xml.ASP", false);
xmlhttp.send(xmlDoc);
My problem is that I have no idea what should go into my xml.ASP page to receive the xmlDoc and prompt me to save to an xml file.
I have this so far, but really don't know where to go from here:
<%
response.ContentType="text/xml"
set xmldoc = Server.CreateObject("Microsoft.XMLDOM")
xmldoc.async=false
xmldoc.load(request)
%>
Any help is greatly appreciated.
Thanks.