Update xml.js

This commit is contained in:
Namhyeon Go 2020-11-05 12:05:52 +09:00
parent 84ae151055
commit 484d6cc500

View File

@ -16,14 +16,20 @@ var createXMLObject = function() {
};
var loadXMLFile = function(filename) {
var doc = createXMLObject();
var doc;
try {
doc = createXMLObject();
if (FILE.fileExists(filename)) {
doc.loadXML(FILE.readFile(filename, "utf-8"));
} else {
console.log("The file does not exists");
console.error("The file does not exists");
return;
}
} catch(e) {
console.error(e.message);
}
return {
select: function(path) {