forked from ScoDoc/ScoDoc
soften xml formation element
This commit is contained in:
parent
d435f3b835
commit
0a000afba4
@ -180,8 +180,14 @@ def formation_import_xml(doc: str, import_tags=True):
|
||||
log("formation_import_xml: invalid XML data")
|
||||
raise ScoValueError("Fichier XML invalide")
|
||||
|
||||
f = dom.getElementsByTagName("formation")[0] # or dom.documentElement
|
||||
D = sco_xml.xml_to_dicts(f)
|
||||
try:
|
||||
f = dom.getElementsByTagName("formation")[0] # or dom.documentElement
|
||||
D = sco_xml.xml_to_dicts(f)
|
||||
except:
|
||||
raise ScoValueError(
|
||||
"Le document xml ne correspond pas à un programme BUT. (élément 'formation' inexistant "
|
||||
"par exemple)."
|
||||
)
|
||||
assert D[0] == "formation"
|
||||
F = D[1]
|
||||
# F_quoted = F.copy()
|
||||
|
Loading…
Reference in New Issue
Block a user