Hi Team,
I am stuck up with writing data into XML.
I have used the following code:
var text = ”;
//XML Read
xmlhttp=new XMLHttpRequest();
xmlhttp.open(“GET”,”AllDetails.xml”,false);
xmlhttp.setRequestHeader(‘Content-Type’, ‘text/xml’);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
alert(‘Started’);
text = text + ‘<User Name=”‘ + Name +'” ‘+ ‘Age=”‘ + Age +'” ‘+’City=”‘ + City + ‘” ‘;
text = text + ‘Country=”‘ + Country+ ‘” />’ ;
alert(text);
//xmlDoc=loadXMLString(text);
xmlhttp.open(“POST”,”AllDetails.xml”,true);
xmlhttp.setRequestHeader(“Content-type”,”text/xml”);
xmlhttp.send(text);
alert(‘Finished Writing XML’);
I dont know where I went wrong. Please help me in this.