On Wed, Sep 18, 2013 at 1:59 PM, Roy Smith <r...@panix.com> wrote: > I can create an Element with a 'foo' attribute by doing: > > etree.Element('my_node_name', foo="spam") > > But, how do I handle something like: > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance", since "xmlns:xsi" > isn't a valid python identifier? >
Try this: etree.Element('my_node_with_invalid_identifiers_name', **{'xmlns:xsi': 'spam'}) HTH, -- Zach -- https://mail.python.org/mailman/listinfo/python-list