Skip to content

Commit

Permalink
Use XMLValidator in file
Browse files Browse the repository at this point in the history
  • Loading branch information
sravani1510 committed Oct 9, 2024
1 parent 22a4d52 commit d443574
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions lib/Deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* eslint-disable default-param-last */

const deprecate = require('depd');
const { XMLParser } = require('fast-xml-parser');
const { XMLParser, XMLValidator } = require('fast-xml-parser');

const iPgmDeprecate = deprecate('iPgm');
const iSqlDeprecate = deprecate('iSql');
Expand Down Expand Up @@ -678,7 +678,7 @@ class iDataQueue {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -741,7 +741,7 @@ class iDataQueue {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -797,7 +797,7 @@ class iDataQueue {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -980,7 +980,7 @@ class iNetwork {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -1211,7 +1211,7 @@ class iNetwork {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -1371,7 +1371,7 @@ class iObj {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -1525,7 +1525,7 @@ class iObj {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -1723,7 +1723,7 @@ class iObj {

const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -1971,7 +1971,7 @@ class iObj {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -2200,7 +2200,7 @@ class iObj {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -2345,7 +2345,7 @@ class iObj {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -2483,7 +2483,7 @@ class iObj {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -2699,7 +2699,7 @@ class iProd {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -2875,7 +2875,7 @@ class iProd {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -3019,7 +3019,7 @@ class iProd {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -3157,7 +3157,7 @@ class iUserSpace {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -3228,7 +3228,7 @@ class iUserSpace {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -3298,7 +3298,7 @@ class iUserSpace {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -3365,7 +3365,7 @@ class iUserSpace {

const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -3543,7 +3543,7 @@ class iWork {
}
const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -3651,7 +3651,7 @@ class iWork {

const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -3809,7 +3809,7 @@ class iWork {

const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -3923,7 +3923,7 @@ class iWork {

const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -4086,7 +4086,7 @@ class iWork {

const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down Expand Up @@ -4217,7 +4217,7 @@ class iWork {

const parser = new XMLParser();
const result = parser.parse(str);
if (Object.keys(result).length === 0) {
if (!XMLValidator.validate(str, { allowBooleanAttributes: true })) {
if (this.reportError) {
cb(Error('Unable to parse the xml input'), null);
return;
Expand Down

0 comments on commit d443574

Please sign in to comment.