albanm / node-libxml-xsd

XSD validation for node.js using libxml.
70 stars 28 forks source link

Excessive depth in document: 256 use XML_PARSE_HUGE option #17

Closed dardanKG closed 7 years ago

dardanKG commented 7 years ago

I have a 7mb xml file I am trying to validate. is it possible to add this option in somehow?

albanm commented 7 years ago

The xsd.parse method accepts a Document object parsed by libxmljs, see https://github.com/albanm/node-libxml-xsd

And it seems that libxmljs supports this option: https://github.com/libxmljs/libxmljs/issues/372

So I guess this code (not tested) should work:

var xsd = require('libxml-xsd');
var schema = xsd.parse(xsd.libxmljs.parseXml(xml, {huge: true}))
...
dardanKG commented 7 years ago

Thank you!