def etree_to_dict(element, iterable=(list,list.append)): if (element.text is None) or element.text.isspace(): retval = odict() for elt in element: if not (elt.tag in retval): retval[elt.tag] = iterable[0]() iterable[1](retval[elt.tag], etree_to_dict(elt, iterable)) else: retval = element.text return retval
def etree_to_dict(element, iterable=(list, list.append)): if (element.text is None) or element.text.isspace(): retval = odict() for elt in element: if not (elt.tag in retval): retval[elt.tag] = iterable[0]() iterable[1](retval[elt.tag], etree_to_dict(elt, iterable)) else: retval = element.text return retval
def __init__(self, app): self.namespaces = odict() self.imports = {} self.tns = app.get_tns() self.app = app self.classes = {}
def __init__(self): self.elements = odict() self.types = odict()
def __init__(self, app): self.namespaces = odict() self.imports = {} self.tns = app.get_tns() self.app = app self.classes = {}
def __init__(self): self.elements = odict() self.types = odict()