xsd-schema-validator
A (XSD) schema validator for nodejs
Last updated a year ago by nikku .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install xsd-schema-validator 
SYNC missed versions from official npm registry.

xsd-schema-validator

Build Status

A (XSD) schema validator for NodeJS that uses Java to perform the actual validation.

Prerequisites

This utility assumes that javac and java are on the path or that the JAVA_HOME environment exists and points to an installed JDK.

On some platforms, i.e. Mac OSX you need to define JAVA_HOME manually.

How to Use

Install via npm:

npm install --save xsd-schema-validator

Use in your application:

var validator = require('xsd-schema-validator');

var xmlStr = '<foo:bar />';

validator.validateXML(xmlStr, 'resources/foo.xsd', function(err, result) {
  if (err) {
    throw err;
  }

  result.valid; // true
});

You may validate readable streams, too:

var xmlStream = fs.createReadableStream('some.xml');

validator.validateXML(xmlStream, ...);

...and files, too:

validator.validateXML({ file: 'some.xml' }, ...);

Why

Because Java can do schema validation and NodeJS cannot.

License

MIT

Current Tags

  • 0.6.0                                ...           latest (a year ago)

10 Versions

  • 0.6.0                                ...           a year ago
  • 0.5.0                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.1                                ...           4 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
  • 0.0.4                                ...           5 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 12
This Month 14
Last Day 10
Last Week 2
Last Month 44
Dependencies (0)
None
Dev Dependencies (5)

Copyright 2014 - 2016 © taobao.org |