mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 23:41:42 +00:00
Update xml.js
This commit is contained in:
parent
84ae151055
commit
484d6cc500
18
lib/xml.js
18
lib/xml.js
|
@ -16,13 +16,19 @@ var createXMLObject = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
var loadXMLFile = function(filename) {
|
var loadXMLFile = function(filename) {
|
||||||
var doc = createXMLObject();
|
var doc;
|
||||||
|
|
||||||
if (FILE.fileExists(filename)) {
|
try {
|
||||||
doc.loadXML(FILE.readFile(filename, "utf-8"));
|
doc = createXMLObject();
|
||||||
} else {
|
|
||||||
console.log("The file does not exists");
|
if (FILE.fileExists(filename)) {
|
||||||
return;
|
doc.loadXML(FILE.readFile(filename, "utf-8"));
|
||||||
|
} else {
|
||||||
|
console.error("The file does not exists");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch(e) {
|
||||||
|
console.error(e.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user