[#64] Fix validation exception when resource-type was missing

This commit is contained in:
amercader 2014-03-14 12:36:01 +00:00
parent 3be77f38cb
commit 4814ad60bb
1 changed files with 7 additions and 1 deletions

View File

@ -120,7 +120,13 @@ class ISO19139EdenSchema(XsdValidator):
xml - etree of the ISO19139 XML record
'''
iso_parser = ISODocument(xml_tree=xml)
return iso_parser.read_value('resource-type')[0]
record_types = iso_parser.read_value('resource-type')
if len(record_types):
return record_types[0]
else:
return 'dataset'
class ISO19139NGDCSchema(XsdValidator):
'''