nikku / node-xsd-schema-validator

A schema (XSD) validator for NodeJS
https://www.npmjs.com/package/xsd-schema-validator
MIT License
51 stars 24 forks source link

WITH_ERRORS result #4

Closed token97 closed 9 years ago

token97 commented 9 years ago

hey. i try to use your validator, but for each test i always get the same response : { valid: false, result: 'WITH_ERRORS', messages: [] } even if the xml is valid (I test on several online xml validator).

var xmlStr = '<?xml version="1.0"?><comment><author>author</author><content>nothing</content></comment>';

validator.validateXML(xmlStr , schemaPath , function(err, result) {
                console.log(result);
                if (err) {
                    throw err;
                }
                result.valid; // true
            });

this is the shema content (replacing "()" by "<>"):

 (xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema")(xs:element name="comment")(xs:complexType)(xs:all)(xs:element name="author" type="xs:string"/)(xs:element name="content" type="xs:string"/)(/xs:all)(/xs:complexType)(/xs:element)(/xs:schema)

Same issue when I'm using examples into validatorSpec with BPMN20.xsd...

nikku commented 9 years ago

What is your java / nodejs runtime / operating system version?

Does the test suite (grunt test) pass for you?