I want to generate the following xml file:
<foo if="bar"/>
I've tried this:
from lxml import etree
etree.Element("foo", if="bar")
But I got this error:
page = etree.Element("configuration", if="ok")
^
SyntaxError: invalid syntax
Any ideas?
I'm using python 2.7.9 and lxml 3.4.2