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


Groups > comp.lang.python > #54392

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

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <roy@panix.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'attribute': 0.07; 'element': 0.07; 'subject: -- ': 0.07; 'subject:question': 0.10; 'python': 0.11; 'doing:': 0.16; 'received:166.84': 0.16; 'received:166.84.1': 0.16; 'received:166.84.1.89': 0.16; 'received:24.136': 0.16; 'received:mailbackend.panix.com': 0.16; 'received:panix.com': 0.16; 'roy': 0.16; 'subject:skip:e 10': 0.16; 'to:name:python list': 0.16; 'received:166': 0.19; '---': 0.24; 'received:24': 0.27; 'subject:the': 0.34; 'subject:with': 0.35; 'something': 0.35; 'charset:us-ascii': 0.36; 'url:org': 0.36; 'handle': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'skip:x 10': 0.40; 'how': 0.40; 'header:Message-Id:1': 0.63; 'smith': 0.68; "'foo'": 0.84; 'email addr:panix.com': 0.84
From Roy Smith <roy@panix.com>
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding quoted-printable
Date Wed, 18 Sep 2013 14:59:19 -0400
Subject lxml question -- creating an etree.Element attribute with ':' in the name
To Python List <python-list@python.org>
Mime-Version 1.0 (Apple Message framework v1283)
X-Mailer Apple Mail (2.1283)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.128.1379530768.18130.python-list@python.org> (permalink)
Lines 15
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1379530769 news.xs4all.nl 15942 [2001:888:2000:d::a6]:39951
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:54392

Show key headers only | View raw


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


Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web