[lxml-dev] Difference between xhtml etrees

D dalist0 at gmail.com
Tue Jun 9 21:14:54 CEST 2009


 Hello,


 I have two xhtml documents which I would like to compare. They are
 available as etrees.
 Ideally I would like to have a resulting tree, where the appropriate
 changes are marked with ins and del tags. I don't need anything fancy
like a detection of moves.

 I had a look at lxml.html.diff
 http://codespeak.net/lxml/lxmlhtml.html#html-diff
 but it operates on html strings only, and not on my parsed tree.
 That solution would mean that I have to dump the xhtml to html, diff,
 reparse the string as html and transform it to xml.
 I like the way daisydiff operates, but again only on files, and the
 output is either html, or xml, which I would need to merge
 into my tree.
 http://code.google.com/p/daisydiff/wiki/Examples
 Is there any way to compare two trees directly and interpret the
 differences the way daisydiff does, i.e. look only at text?

 Daniel


More information about the lxml-dev mailing list