Fixed error reporting

This commit is contained in:
Patrick Steele-Idem 2014-10-22 14:57:43 -06:00
parent 0a3cb07a42
commit 8f171379bb

View File

@ -208,6 +208,9 @@ ElementNode.prototype = {
if (preserveWhitespace) {
this.removePreserveSpaceAttr();
}
var _this = this;
template.text('<' + name);
this.forEachAttributeAnyNS(function (attr) {
var prefix = attr.prefix;
@ -243,9 +246,9 @@ ElementNode.prototype = {
},
error: function (message) {
invalidAttr = true;
this.addError('Invalid expression found in attribute "' + name + '". ' + message);
_this.addError('Invalid expression found in attribute "' + name + '". ' + message);
}
}, this);
});
if (invalidAttr) {
template.text(name + '="' + escapeXmlAttr(attr.value) + '"');