How can I detect changes in XML?

In Python, is there an easy way to edit XML in place?

  • Suppose I want to edit a node in XML and edit one of its attributes. I want to be able to do a simple file diff to just see one row changed. Dumping the XML using prettyprint changes the whole XML structure.

  • Answer:

    Does LXML's tree-modifying APIs suit your needs? http://codespeak.net/lxml/parsing.html#modifying-the-tree

Vaibhav Mallya at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.