explanationList
This commit is contained in:
@@ -5,7 +5,7 @@ from model.tags import export_tag
|
||||
def export_to_xml(model):
|
||||
xml_document = export_entry(model.entry)
|
||||
serializer = __new__(XMLSerializer())
|
||||
return serializer.serializeToString(xml_document);
|
||||
return serializer.serializeToString(xml_document)
|
||||
|
||||
|
||||
def export_entry(entry):
|
||||
@@ -155,17 +155,21 @@ def export_translation(doc, translation):
|
||||
actual_t.setAttribute("source", translation.source)
|
||||
translation_xml.appendChild(actual_t)
|
||||
|
||||
explanationList = doc.createElement("explanationList")
|
||||
|
||||
for explanation in translation.explanationList:
|
||||
explanationList.appendChild(explanation.export(doc))
|
||||
|
||||
translation_xml.appendChild(explanationList)
|
||||
if len(translation.explanationList) > 0 :
|
||||
explanationList = _export_explanation_list(doc, translation.explanationList)
|
||||
translation_xml.appendChild(explanationList)
|
||||
|
||||
|
||||
|
||||
return translation_xml
|
||||
|
||||
def _export_explanation_list(doc, lst):
|
||||
result = doc.createElement('explanationList')
|
||||
for explanation in lst:
|
||||
console.log(explanation)
|
||||
result.appendChild(explanation.export(doc))
|
||||
|
||||
return result
|
||||
|
||||
def _export_label_list(doc, lst):
|
||||
result = doc.createElement("labelList")
|
||||
|
||||
Reference in New Issue
Block a user