From The Compiler, 10 Years ago, written in Python.
Embed
  1. xpath = "/EtherCATInfo/Descriptions/Devices/Device[1]/Profile[1]/Dictionary"
  2.  
  3. oldtree = etree.parse(filename)
  4. root = oldtree.getroot()
  5. oldnode = root.xpath(xpath)[0]
  6.  
  7. root.replace(oldnode, newnode)

Replies to etree rss

Title Name Language When
Re: etree anonymous python 10 Years ago.