I have an XML file and an XML schema in another file and I’d like to validate that my XML file adheres to the schema. How do I do this in Python? I’d prefer something using the standard library, but I can install a third-party package if necessary. Answer I am assuming you mean using XSD files. Surprisingly there aren’t
Tag: validation
Validate (X)HTML in Python
What’s the best way to go about validating that a document follows some version of HTML (prefereably that I can specify)? I’d like to be able to know where the failures occur, as in a web-based validator, except in a native Python app. Answer XHTML is easy, use lxml. HTML is harder, since there’s traditionally not been as much interest