if element.tag[0] == '{':
for nshort, nhref in element.nsmap.items():
try:
if element.tag[0] == '{':
for nshort, nhref in element.nsmap.items():
try:
if element is None: return None # end of tree
def _handle_element(self, element):
if element is None: return None # end of tree
def _handle_element(self, element):
else:
vals = handler(element)
# depending on number of returned values, vals can be None, a value, or a tuple.
# how poorly designed is that? 9 lines below are needed just to unpack this.
if vals is None:
else:
vals = handler(element)
# depending on number of returned values, vals can be None, a value, or a tuple.
# how poorly designed is that? 9 lines below are needed just to unpack this.
if vals is None:
else:
if not isinstance(vals, tuple):
return [vals, self.filter_text(element.tail)]
else:
if not isinstance(vals, tuple):
return [vals, self.filter_text(element.tail)]