Skip to content

validate each NXDL file before using it #17

@prjemian

Description

@prjemian

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions