I'm new to javascript and jQuery. I'm trying to get an XML string, update the value of one of the elements and get the new XML.
var header = "<RECORDS>" +
"<USERDATA>" +
"<USERID>ABC</USERID>" +
"<UTEMPLATE>NEWLOAN</UTEMPLATE>" +
"<FILEID></FILEID>" +
"<ENTITY>DW</ENTITY>" +
"</USERDATA>" +
"</RECORDS>";
var fileID = "XXXXXXXXXXXXXXX";
var xDoc = $.parseXML(header);
var $xml = $(xDoc);
var $elmFileID = $xml.find("FILEID");
$elmFileID.text(fileID);
This is what I have so for from examples I've seen but I don't know if it's right or what to do next.
What I want is a resulting string(either the existing header var or even a new var) with the content of the FILEID element as "XXXXXXXXXXXXXXX". Eventually that string will come from a service.