Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you were going to start from scratch, a useful search term would be "tree diff".</p> <p>There's a pretty awesome blog post <a href="http://useless-factor.blogspot.com/2008/01/matching-diffing-and-merging-xml.html" rel="nofollow noreferrer">here</a>, although I just found it by googling "daisydiff python" so I bet you've already seen it. Besides all the interesting theoretical stuff, he mentions the existence of <a href="http://www.logilab.org/859" rel="nofollow noreferrer">Logilab's <code>xmldiff</code></a>, an open-source XML differ written in Python. That might be a decent starting point — maybe less correct than trying to wrap or reimplement DaisyDiff, but probably easier to get up and running quickly.</p> <p>There's also <a href="http://pypi.python.org/pypi/html-tree-diff/0.1.2" rel="nofollow noreferrer">html-tree-diff</a> on pypi, which I found via this Quora link: <a href="http://www.quora.com/Is-there-any-good-Python-implementation-of-a-tree-diff-algorithm" rel="nofollow noreferrer">http://www.quora.com/Is-there-any-good-Python-implementation-of-a-tree-diff-algorithm</a></p> <p>There's some theoretical stuff about tree diffing at <a href="https://cstheory.stackexchange.com/questions/10205/efficient-diff-algorithm-for-trees-and-levenshtein-distance">efficient diff algorithm for trees and Levenshtein distance</a> on cstheory.stackexchange.</p> <p>BTW, just to clarify, you <em>are</em> talking about diffing two DOM trees, but not necessarily rendering the diff/merge back into any particular HTML, right? <strong>(EDIT: Right.)</strong> A lot of the similarly-worded questions on here are really asking "how can I color deleted lines red and added lines green" or "how can I make matching paragraphs line up visually", skipping right over the theoretical hard part of "how do I diff two DOM trees in the first place" and the practical hard part of "how do I parse possibly malformed HTML into a DOM tree even before that". :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload