
Product
Introducing License Overlays: Smarter License Management for Real-World Code
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
xsd-schema-validator
Advanced tools
A (XSD) schema validator for NodeJS that uses Java to perform the actual validation. :arrow_right: Why?
Under the hood, this utility uses Java to do the actual validation.
It assumes that javac
and java
are on the path. If a JAVA_HOME
environment variable exists it uses that to locate an installed JDK.
On some platforms, i.e. Mac OSX you need to define JAVA_HOME
manually.
Install the package via npm:
npm install --save xsd-schema-validator
Use in your application:
var validator = require('xsd-schema-validator');
var xmlStr = '<foo:bar />';
try {
const result = await validator.validateXML(xmlStr, 'resources/foo.xsd');
result.valid; // true
} catch (err) {
console.error('validation error', err);
}
You may validate readable streams:
var xmlStream = fs.createReadableStream('some.xml');
const result = await validator.validateXML(xmlStream);
You may validate files, too:
const result = validator.validateXML({ file: 'some.xml' }, ...);
Because Java can do schema validation and NodeJS cannot.
MIT
0.11.0
FEAT
: add insecure
option to be able to parse huge schemata (#44)FAQs
A (XSD) schema validator for nodejs
The npm package xsd-schema-validator receives a total of 10,381 weekly downloads. As such, xsd-schema-validator popularity was classified as popular.
We found that xsd-schema-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.