我使用以下方法验证一个5GB的大型XML文档:
from lxml.etree fromstring, XMLSchema
xmlschema = XMLSchema(xmlschema_doc)
root = fromstring(open(myfilepath).read())
xmlschema.assertValid(root)
但是,我开始遇到内存不足的错误:
OSError: [Errno 12] Cannot allocate memory
有没有一种“在运行中”的方法可以在xml中进行xsd验证,而不必将所有内容都加载到内存中?如果是,我该怎么做?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐