| Store | Cart

Understanding the arguments for SubElement factory in ElementTree

From: B Mahoney <mrbm...@gmail.com>
29 Oct 2005 11:08:55 -0700
Your SubElement call is lacking the attrib argument, but you can't set
text, anyway.

The elementtree source makes it clear, you can only set element attrib
attributes
with SubElement

def SubElement(parent, tag, attrib={}, **extra):
    attrib = attrib.copy()
    attrib.update(extra)
    element = parent.makeelement(tag, attrib)
    parent.append(element)
    return element

Recent Messages in this Thread
mira...@yahoo.com Oct 29, 2005 06:39 am
B Mahoney Oct 29, 2005 06:08 pm
Giovanni Bajo Oct 30, 2005 07:12 pm
Messages in this thread