From 76c80baa09a2b72486749988b5571e5bf071b8a8 Mon Sep 17 00:00:00 2001 From: matic_t Date: Thu, 27 Aug 2020 00:20:58 -0700 Subject: [PATCH] remove saving original from grammar --- src/export.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/export.py b/src/export.py index c5be07d..c691b4b 100644 --- a/src/export.py +++ b/src/export.py @@ -57,17 +57,12 @@ def export_entry(entry): lexunit.appendChild(lexeme) head.appendChild(lexunit) -# Example of keeping original xml and adding changes to it only - grammar_category = entry.original_xml.querySelector("head grammar category") - if grammar_category is None: - grammar = doc.createElement("grammar") - grammar_category = doc.createElement("category") - grammar.appendChild(grammar_category) - entry.original_xml.querySelector("head").appendChild(grammar_category) + grammar = doc.createElement("grammar") + grammar_category = doc.createElement("category") grammar_category.textContent = entry.grammar - - head.appendChild(entry.original_xml.querySelector("head grammar")) + grammar.appendChild(grammar_category) + head.appendChild(grammar) if len(entry.measure) > 0: