I have an AJAX response of XML file in a variable. After doing changes in the elements, I want to save it as formatted XML.
function sendXML() {
var serializer = new XMLSerializer();
var toString = serializer.serializeToString(xml_dom);
$.ajax({
type: "POST",
url: "/ReceiverService/printerconfigxml",
dataType: "text",
data: {
val: toString
},
});
};
xml_dom
is the variable in which the AJAX response is stored (entire XML).
On the other side, the servlet is handling the saving part, but I want to send formatted XML to the servlet.