Hello,
I'm new to lxml and I'm trying to get more information on why some
validation is failing. Here is the code I am currently using:
try:
xmlschema.assertValid(xml_doc)
except etree.DocumentInvalid:
traceback.print_exc()
print log
print error.domain_name
print error.type_name
sys.exit()
Here's the output I get:
Traceback (most recent call last):
File "./xml.py", line 42, in ?
xmlschema.assertValid(xml_doc)
File "etree.pyx", line 1624, in etree._Validator.assertValid
DocumentInvalid: Document does not comply with schema
Traceback (most recent call last):
File "./xml.py", line 46, in ?
print error.domain_name
AttributeError: 'NoneType' object has no attribute 'domain_name'
Is there any way to get more information than this?
Thanks,
Adhamh
|