diff --git a/config.json b/config.json index d436be049b8c6359dac78ad4367fa7602a30727c..1bcfbaaa15259c32f01c35e3f954fcfc9c738e7b 100644 --- a/config.json +++ b/config.json @@ -7,8 +7,7 @@ "dir":"." }, "xsd":{ - "dir":"../DCC/schemata", - "file": "DCC_v1.9.xsd", - "url": "https://intranet.ptb.de/fileadmin/dokumente/intranet/abteilungen/abteilung_1/Digitaler_Kalibrierschein/DCC" + "dir":"../DCC", + "file": "dcc.xsd" } } diff --git a/utils.py b/utils.py index d8fa1badb186f8f5b4d5fa9403220e07f5cb8b24..4a4a3845c26b4fc035c0aa13ad546e13f1773f48 100644 --- a/utils.py +++ b/utils.py @@ -48,11 +48,14 @@ def parse(xml_str): return tree def get_xsd_version(xsd_str): - tree = parse(xsd_str) - for annotation in tree.findall("w3:annotation", ns): - version_text = annotation.find("w3:documentation", ns).text - - return version_text + """The version is tag is a declaration and so + not part of the parse tree + """ + root = parse(xsd_str) + if root.tag.endswith("schema"): + return root.attrib.get("version", "") + else: + return "" def validate(xml_str, xsd_str): tree = parse(xml_str)