diff --git a/src/utils/libeoaconvert.py b/src/utils/libeoaconvert.py index b508d4c..06ec58d 100644 --- a/src/utils/libeoaconvert.py +++ b/src/utils/libeoaconvert.py @@ -369,6 +369,21 @@ def transfer_xml_attributes(old_element_attributes, new_element): return # def transfer_xml_attributes ends here + +def check_xml_empty(xml_element): + """Check if an element has neither attributes, text or children""" + + attributes = xml_element.attrib + text = xml_element.text + children = xml_element.getchildren() + + if len(attributes) == 0 and text is None and len(children) == 0: + return True + else: + return False +# def check_xml_empty ends here + + def split_with_milestone_element(element, milestone, splitter): """Split the text of an element by inserting milestone tags."""