Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ID assigner appinfo
  • Loading branch information
kthoden committed Feb 11, 2019
1 parent 6a5e3eb commit f2961c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion idassigner.py
Expand Up @@ -105,7 +105,11 @@ def main():
chapter.tag = "elementtobestripped"

etree.strip_elements(xml_tree, "elementtobestripped")
libeoaconvert.write_appinfo(xml_tree, "id_assigner", __version__, "idassign", "Assign XML IDs to elements", datetime.now().strftime("%Y-%m-%d"))

appinfo_element = xml_tree.xpath("//t:encodingDesc/t:appInfo", namespaces=NS_MAP)[0]
appinfo = libeoaconvert.get_appinfo("id_assigner", __version__, "idassign", "Assign XML IDs to elements", datetime.now().strftime("%Y-%m-%d"))
appinfo_element.insert(0, appinfo)

output = args.teifile.replace(".xml", "-withids.xml")
xml_tree.write(output, pretty_print=True, xml_declaration=True, encoding="utf-8")
logging.info("Wrote %s." % output)
Expand Down

0 comments on commit f2961c4

Please sign in to comment.