Skip to content
Snippets Groups Projects
Commit c6e9138a authored by Rolf Niepraschk's avatar Rolf Niepraschk
Browse files

...

parent d78095dc
Branches
Tags
No related merge requests found
......@@ -51,16 +51,19 @@ def validate():
version = request.args.get('v')
xml_str = request.data
xml_tree = utils.parse(xml_str)
if xml_tree:
try:
utils.parse(xml_str)
app.logger.debug('=== xml_tree OK ===')
xsd_str = utils.get_xsd(releases_dict, xsd_version=version, xml_str=xml_str)
if xsd_str:
app.logger.debug('=== xsd OK ===')
ret = utils.validate(xml_str=xml_str, xsd_str=xsd_str)
else:
app.logger.debug('=== xsd invalid ===')
ret = utils.return_error(error='xsd content not readable')
else:
app.logger.debug('=== xml_tree invalid ===')
ret = utils.return_error(error='invalid xml data')
except:
app.logger.debug('=== xml_tree invalid ===')
ret = utils.return_error(error='invalid xml data')
return utils.xml_response(ret)
......
......@@ -53,9 +53,9 @@ def get_version():
return False
def get_xsd(d, xsd_version=None, xml_str = None):
url = False
url = ''
version = xsd_version
if not version: # We use the internal version information in the XML structure
if not version: # We use the internal version information in the XML data
root = parse(xml_str)
version = root.attrib.get('schemaVersion')
for i in d['releases']:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment