Jan Danielsson wrote: > If have an element tree representing an XML document, and I load > another tree from a file, is there an easy way to stick the second tree > into the first one? > > fooElement = ET.SubElement(...) > > tree = ET.parse(TEMPLDIR + '/welcome.xml') > elem = tree.getroot() > > Now I want to stick elem as a subelement of fooElement. Do I need to > traverse the elem tree manually, or is there a way to just 'stick it in > there'?
Found it two seconds after sending the post. fooElement.append(). Obviously. -- Kind regards, Jan Danielsson -- http://mail.python.org/mailman/listinfo/python-list