-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
Qualify each NXDL file by validating it against the NXDL Schema (nxdl.xsd) before it is used. This will ensure the NXDL is proper (and has no errors introduced).
Here is some python code that does this:
def validate_xml(xml_file_name):
'''
validate an NXDL XML file against an XML Schema file
:param str xml_file_name: name of XML file
'''
xml_tree = lxml.etree.parse(xml_file_name)
xsd = cache.get_XML_Schema()
return xsd.assertValid(xml_tree)
Use the libxml2 library to perform this validation step.