I am using the following to verify a large 5GB XML document:
from lxml.etree fromstring, XMLSchema
xmlschema = XMLSchema(xmlschema_doc)
root = fromstring(open(myfilepath).read())
xmlschema.assertValid(root)
However, I'm starting to hit out of memory errors:
OSError: [Errno 12] Cannot allocate memory
Is there a 'on-the-fly' way to do xsd validation in xml without having to load everything into memory? If so, how would I do that?