How can I validate a XML-Schema?

267 Views Asked by At

I don't have a lot of experience working with XML Schema definitions. I am working with a definition that consists of several XSD files and that is provided by a third party.

Now I've come to a point where I want to make sure that the XSD files are free of errors. So my question is whether how one can check an XML schema definition for errors.

I work with the Python library "xmlschema". The schema could be read in with xmlschema.XMLSchema (filename) without any problems. Is that already a clear indicator that the definition is free of errors? Furthermore, I ask myself whether the error-free reading not only means that the definition is syntactically correct, but there could still be logical errors.

1

There are 1 best solutions below

0
On

If you run xmlschema.XMLSchema(filename) the default validation mode is strict. This would cause to show an error message when the XSD file is not correct. I tested to change a name of a type, that is used in another element. This raises an exception on load.

Without Error enter image description here

With Error (machineIdType renamed to machineIdTyp) enter image description here