5 from xml.dom.minidom
import parse
8 def main(from_file, to_file):
9 root = parse(from_file)
13 links = root.getElementsByTagName(
"link")
14 joints = root.getElementsByTagName(
"joint")
16 name = link.getAttribute(
"name")
17 if re.match(
".*_cb_link$", name):
18 link.parentNode.removeChild(link)
20 name = joint.getAttribute(
"name")
21 if re.match(
".*_cb$", name):
22 joint.parentNode.removeChild(joint)
23 with open(to_file,
"w")
as f:
27 if __name__ ==
"__main__":
28 main(sys.argv[1], sys.argv[2])
def main(from_file, to_file)