def mavgen_validate(fname, schema, errorLimitNumber): """Uses minixsv to validate an XML file with a given XSD schema file. We define mavgen_validate here because it relies on the XML libs that were loaded in mavgen(), so it can't be called standalone""" # use default values of minixsv, location of the schema file must be specified in the XML file domTreeWrapper = pyxsval.parseAndValidate(fname, xsdFile=schema, errorLimit=errorLimitNumber)
def mavgen_validate(fname, schema, errorLimitNumber) : """Uses minixsv to validate an XML file with a given XSD schema file.""" # use default values of minixsv, location of the schema file must be specified in the XML file domTreeWrapper = pyxsval.parseAndValidate(fname, xsdFile=schema, errorLimit=errorLimitNumber) # domTree is a minidom document object domTree = domTreeWrapper.getTree()
def pprz_validate(fname, schema, errorLimitNumber) : """Uses minixsv to validate an XML file with a given XSD schema file. We define pprz_validate here because it relies on the XML libs that were loaded in gen_messages(), so it can't be called standalone""" # use default values of minixsv, location of the schema file must be specified in the XML file try: domTreeWrapper = pyxsval.parseAndValidate(fname, xsdFile=schema, errorLimit=errorLimitNumber) except pyxsval.XsvalError, errstr: print(errstr) return 1
def mavgen_validate(fname, schema, errorLimitNumber) : """Uses minixsv to validate an XML file with a given XSD schema file. We define mavgen_validate here because it relies on the XML libs that were loaded in mavgen(), so it can't be called standalone""" # use default values of minixsv, location of the schema file must be specified in the XML file domTreeWrapper = pyxsval.parseAndValidate(fname, xsdFile=schema, errorLimit=errorLimitNumber)