awacke1 commited on
Commit
81ab5e3
·
1 Parent(s): 0578948

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -39,11 +39,9 @@ def get_table_download_link(file_path):
39
  return href
40
 
41
  def CompressXML(xml_text):
42
- tree = ET.ElementTree(ET.fromstring(xml_text))
43
- for elem in tree.iter():
44
- if isinstance(elem.tag, ET.Comment):
45
- elem.getparent().remove(elem)
46
- return ET.tostring(tree.getroot(), encoding='unicode')
47
 
48
  def read_file_content(file):
49
  if file.type == "application/json":
@@ -96,3 +94,4 @@ def main():
96
 
97
  if __name__ == "__main__":
98
  main()
 
 
39
  return href
40
 
41
  def CompressXML(xml_text):
42
+ root = ET.fromstring(xml_text)
43
+ ET.strip_elements(root, ET.Comment)
44
+ return ET.tostring(root, encoding='unicode')
 
 
45
 
46
  def read_file_content(file):
47
  if file.type == "application/json":
 
94
 
95
  if __name__ == "__main__":
96
  main()
97
+