mt-additional-xml-shema-support #6
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user