import libxml2
import sys
class ErrorHandler:
raise Exception, "Error handler did not receive correct argument"
# Memory debug specific
dtd="""<!ELEMENT foo EMPTY>"""
valid="""<?xml version="1.0"?>
<foo></foo>"""
invalid="""<?xml version="1.0"?>
<foo><bar/></foo>"""
e = ErrorHandler()
# Test valid document
print "error doing DTD validation"
# Test invalid document
print "Error: document supposed to be invalid"
del dtd
del ctxt
# Memory debug specific
print "OK"
else: