is it possible to merge multiple xmlDocuments into one single file (var newResult) by using jquery (or pure javascript) ?
unfortunately i’ve to combine different hosted xml-documents into one single file (don’t ask me why…). i’ve played around with different techniques, but i can’t find a solution for this (maybe jquery isn’t ready for xml-handling??). thank you 🙂
see my piece of code:
var files = ['john.xml','doe.xml']
var newResult, temp;
function loadMyXMLFiles(){
// > let's load file by file using jquery's ajax-call:
$.each(files, function(index,value) {
$.ajax({
url: value,
cache: true,
success: function(data){
// > check if temp is empty, append or fill
(temp) ? temp += (data) : temp = data;
// > on complete:
if (index == files.length-1) {
xmlResult = temp; temp = null;
}
}
});
});
}
loadMyXMLFiles()

As I can see, you are trying to concatenate them. If this is what you need, your code wasn’t that bad,
You have to use
async: falseso your files arrive in order. But caution, this will hang the browser until the processing is finished. If it’s vital for it not to happen, just tell me.Hope this helps. Cheers