diff --git a/spec/validator_spec.js b/spec/validator_spec.js index 27a25482..2da4f066 100644 --- a/spec/validator_spec.js +++ b/spec/validator_spec.js @@ -42,7 +42,7 @@ describe("XMLParser", function() { it("should return false for non xml text", function() { const xmlData = "rootNode"; - const expected = {code: "InvalidChar", msg: "char r is not expected ."}; + const expected = {code: "InvalidChar", msg: "char r is not expected."}; const result = validator.validate(xmlData).err; //console.log(JSON.stringify(result,null,4)); @@ -390,7 +390,7 @@ describe("XMLParser", function() { +'
' +''; - var expected = { code: 'InvalidChar', msg: 'char " is not expected .' } + var expected = { code: 'InvalidChar', msg: 'char " is not expected.' } var result = validator.validate(xmlData).err; expect(result).toEqual(expected); diff --git a/src/validator.js b/src/validator.js index c0cc83cf..8401672a 100644 --- a/src/validator.js +++ b/src/validator.js @@ -137,7 +137,7 @@ exports.validate = function(xmlData, options) { if (xmlData[i] === ' ' || xmlData[i] === '\t' || xmlData[i] === '\n' || xmlData[i] === '\r') { continue; } - return {err: {code: 'InvalidChar', msg: 'char ' + xmlData[i] + ' is not expected .'}}; + return {err: {code: 'InvalidChar', msg: 'char ' + xmlData[i] + ' is not expected.'}}; } }