Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

detailed-xml-validator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detailed-xml-validator - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

8

package.json
{
"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 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc