def __init__(self, element_or_tree, content_handler): try: element = element_or_tree.getroot() except AttributeError: element = element_or_tree self._element = element self._content_handler = content_handler from xml.sax.xmlreader import AttributesNSImpl as attr_class self._attr_class = attr_class self._empty_attributes = attr_class({}, {})
def __init__(self, element_or_tree, content_handler): try: element = element_or_tree.getroot() except AttributeError: element = element_or_tree self._element = element self._content_handler = content_handler from xml.sax.xmlreader import AttributesNSImpl as attr_class self._attr_class = attr_class self._empty_attributes = attr_class({}, {})