forked from ScoDoc/ScoDoc
Merge pull request 'soften xml formation element' (#191) from jmplace/ScoDoc-Lille:fix_import_xml into PNBUT
Reviewed-on: https://scodoc.org/git/viennet/ScoDoc/pulls/191
This commit is contained in:
commit
ec93a8cdbc
@ -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