I try to copy some elements from one xml to another:
#source
xdoc = parse_file("test.xml")
odm = LightXML.root(xdoc)
st = LightXML.find_element(odm, "Study")
#destination
xd = XMLDocument()
e = create_root(xd, "Study")
elm = collect(LightXML.child_elements(st));
# this remove from source to destination
dc = deepcopy(elm[4])
unlink(dc)
add_child(e, dc)
#this copy all elements to xd ??? why ?
add_child(e, elm[4])
#this copy all elements to xd too
add_child(e, deepcopy(elm[4]))
I try to copy some elements from one xml to another: