def get_content(self, upper=True, as_string=True): if as_string: if len(self.content) == 1: return xml_util.clean(self.content[0], upper=upper) else: return "" else: return map(functools.partial(xml_util.clean, upper=upper), self.content)
def get_attribute(self, key, upper=True): return xml_util.clean(self._attributes.get(key, None), upper=upper)
def get_content(self): if len(self.content) == 1: return xml_util.clean(self.content[0]) else: return map(xml_util.clean, self.content)
def get_attribute(self, key): return xml_util.clean(self._attributes.get(key, None))