I can reproduce, with configuration (on Windows 10, Cygwin):
Python : sys.version_info(major=2, minor=7, micro=13, releaselevel='final', serial=0) lxml.etree : (3, 7, 3, 0) libxml used : (2, 9, 4) libxml compiled : (2, 9, 4) libxslt used : (1, 1, 29) libxslt compiled : (1, 1, 29)
Furthermore, the following suggests the problem is on the validation side, not etree as such:
>>> x=etree.parse("testa.xml") >>> x.root().attrib['foo'] 'true'
I can reproduce, with configuration (on Windows 10, Cygwin):
Python : sys.version_ info(major= 2, minor=7, micro=13, releaselevel= 'final' , serial=0)
lxml.etree : (3, 7, 3, 0)
libxml used : (2, 9, 4)
libxml compiled : (2, 9, 4)
libxslt used : (1, 1, 29)
libxslt compiled : (1, 1, 29)
Furthermore, the following suggests the problem is on the validation side, not etree as such:
>>> x=etree. parse(" testa.xml" ) ).attrib[ 'foo']
>>> x.root(
'true'