Skip to content

Commit

Permalink
Added property validationError to XML document after calling XmlDocum…
Browse files Browse the repository at this point in the history
…ent::Validate.

This gives an ability to see validation error when validating XML with an XSD.

Conflicts:
	src/xml_document.cc
  • Loading branch information
Andrii Nikitiuk authored and defunctzombie committed Jul 14, 2014
1 parent 2135e22 commit 7aacf40
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/xml_document.cc
Expand Up @@ -332,6 +332,9 @@ NAN_METHOD(XmlDocument::Validate)
}
bool valid = xmlSchemaValidateDoc(valid_ctxt, document->xml_obj) == 0;

xmlSetStructuredErrorFunc(NULL, NULL);
args.Holder()->Set(v8::String::New("validationErrors"), errors);

NanReturnValue(NanNew<v8::Boolean>(valid));
}

Expand Down

0 comments on commit 7aacf40

Please sign in to comment.