Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #54392 > unrolled thread

lxml question -- creating an etree.Element attribute with ':' in the name

Started byRoy Smith <roy@panix.com>
First post2013-09-18 14:59 -0400
Last post2013-09-18 14:59 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  lxml question -- creating an etree.Element attribute with ':' in the name Roy Smith <roy@panix.com> - 2013-09-18 14:59 -0400

#54392 — lxml question -- creating an etree.Element attribute with ':' in the name

FromRoy Smith <roy@panix.com>
Date2013-09-18 14:59 -0400
Subjectlxml question -- creating an etree.Element attribute with ':' in the name
Message-ID<mailman.128.1379530768.18130.python-list@python.org>
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?

---
Roy Smith
roy@panix.com


[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web