code_junkie

Validating with an XML schema in Python

Nov 12th, 2011
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.12 KB | None | 0 0
  1. ...
  2. root = etree.XML(_bytes("<b/>"))
  3. dtd = etree.DTD(BytesIO("<!ELEMENT b EMPTY>"))
  4. self.assert_(dtd.validate(root))
Add Comment
Please, Sign In to add comment