detailed-xml-validator
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "detailed-xml-validator", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Validate for XML schema and returns all the possible failures", | ||
@@ -23,9 +23,9 @@ "main": "./src/validator.js", | ||
"dependencies": { | ||
"fast-xml-parser": "^3.20.0" | ||
"fast-xml-parser": "^4.2.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.3.4", | ||
"mocha": "^9.1.1", | ||
"nyc": "^15.1.0", | ||
"chai": "^4.3.4" | ||
"nyc": "^15.1.0" | ||
} | ||
} |
/// @ts-check | ||
const parser = require("fast-xml-parser"); | ||
const {XMLParser, XMLValidator} = require("fast-xml-parser"); | ||
const Traverser = require("./Traverser"); | ||
@@ -13,8 +13,9 @@ | ||
validateXMlData(rules); | ||
this.rules = parser.parse(rules, { | ||
const ruleParser = new XMLParser({ | ||
ignoreAttributes: false, | ||
attrNodeName: "@rules", | ||
attributesGroupName: "@rules", | ||
attributeNamePrefix: "", | ||
allowBooleanAttributes: true | ||
}); | ||
this.rules = ruleParser.parse(rules); | ||
this.options = Object.assign({}, defaultOptions, options); | ||
@@ -29,8 +30,9 @@ this.validators={}; | ||
validateXMlData(xmldata); | ||
const xmlObj = parser.parse(xmldata, { | ||
const parser = new XMLParser({ | ||
ignoreAttributes: false, | ||
attrNodeName: ":a", | ||
attributesGroupName: ":a", | ||
attributeNamePrefix: "", | ||
parseNodeValue: false | ||
parseTagValue: false | ||
}); | ||
const xmlObj = parser.parse(xmldata); | ||
this.data = xmlObj; | ||
@@ -50,3 +52,3 @@ const traverser = new Traverser(this.options,this.validators); | ||
let xmlObj; | ||
let result = parser.validate(xmldata, { | ||
let result = XMLValidator.validate(xmldata, { | ||
allowBooleanAttributes: true | ||
@@ -53,0 +55,0 @@ }); |
62262
24
1545
+ Addedfast-xml-parser@4.5.1(transitive)
- Removedfast-xml-parser@3.21.1(transitive)
Updatedfast-xml-parser@^4.2.0