mt-additional-xml-shema-support #6

Merged
lkavcic merged 10 commits from mt-additional-xml-shema-support into master 2020-08-14 09:32:35 +00:00
Showing only changes of commit 85bf0473e5 - Show all commits

View File

@ -9,7 +9,6 @@ def export_to_xml(model):
def export_entry(entry):
console.log(entry)
parser = __new__(DOMParser())
doc = parser.parseFromString("<entry />", "text/xml")
entry_xml = doc.firstChild
@ -58,6 +57,7 @@ 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")
@ -68,11 +68,7 @@ def export_entry(entry):
grammar_category.textContent = entry.grammar
head.appendChild(entry.original_xml.querySelector("head grammar"))
# if (grammar_category)
# entry.original_xml.querySelector("head grammar category").textContent
# grammar.appendChild(grammar_category)
# head.appendChild(grammar)
if len(entry.measure) > 0:
measure_list = doc.createElement("measureList")
@ -182,7 +178,6 @@ def export_translation(doc, translation):
def _export_explanation_list(doc, lst):
result = doc.createElement('explanationList')
for explanation in lst:
console.log(explanation)
result.appendChild(explanation.export(doc))
return result