[Python]Xml add a node from another xml document

gogo

New Member
I have two xml file:1)model.xml 2)projectionParametersTemplate.xmlI want to extract from 1) Algorithm Node with his child and put it in 2)I have wrote this code but it doesn't function.\[code\]from xml.dom.minidom import Documentfrom xml.dom import minidom xmlmodel=minidom.parse("/home/michele/Scrivania/d/model.xml")xmltemplate=minidom.parse("/home/michele/Scrivania/d/projectionParametersTemplate.xml")for Node in xmlmodel.getElementsByTagName("Algorithm"): print "\nNode: "+str(Node) for Node2 in xmltemplate.getElementsByTagName("ProjectionParameters"): print "\nNode2: "+str(Node2) Node2.appendChild(Node)\[/code\]This is model.xml link textThis is projectionParametersTemplate.xml link textThanks a lot.
 
Top