Copying Elements using PyXML

Pat Notz pknotz at
Tue Sep 24 15:27:53 EDT 2002

This is an untested snippet of code that should get you started.  It
looks like you'll want to do you .appendChild on a node other than

# Merge subsequet DOMs
dom = None
for xmlfile in xmlfiles:
    tmp_dom = xml.dom.minidom.parse(xmlfile)
    if dom == None:
        dom = tmp_dom
        for node in tmp_dom.documentElement.childNodes:
            e = dom.importNode(node,True)

More information about the Python-list mailing list