lxml/lxml — Issue #28: DTD validation ignored required attributes
Author: ukch
Created: 2012-01-13 11:40:44+00:00
State: open

Consider the following code:

```python
import StringIO
import lxml.etree as etree

XML = """\

]>

"""

parser = etree.XMLParser(load_dtd=True, attribute_defaults=True)
tree = etree.parse(StringIO.StringIO(XML), parser=parser)
tree.docinfo.internalDTD.assertValid(tree)
```

This code ought to fail with an error saying that both `data` and `column` elements need an `id` attribute (as the validator at http://www.xmlvalidation.com/ does), but instead it passes silently.