minixsv (via) As far as I can tell, this is the only library that can validate XML using pure Python (no C extension required). I’d be extremely happy if someone would write a pure Python library (or one that only depends on ElementTree, which is included in the standard library) for validating XML against a Relax NG Compact syntax schema. Even DTD validation would be better than nothing!
Unfortunately it's entirely undocumented - here's how I got it to work:
The resulting exception is just a plain string rather than a more useful data structure - it looks like this: u"ERROR: shiporder.xsd: line 19: Unexpected or invalid child tag (u'http://www.w3.org/2001/XMLSchema', u'compl3xType') found in tag (u'http://www.w3.org/2001/XMLSchema', u'element')!"