leemic2004 / daisydiff

Automatically exported from code.google.com/p/daisydiff
0 stars 0 forks source link

duplication of the content #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create 2 identic html files
2.Delete some text from the middle of an HTML element, so some text remains
in the element before and after the deleted text 
3.Change some attributes of the HTML element with the deleted text.

What is the expected output? What do you see instead?
Expected: display of all the text with the deleted text highlighted in red 
and crossed out
Instead: some of the remaining text is duplicated.

Please use labels and text to provide additional information.
The problem again lies in the comparison of tags by semantic rather than 
object comparison. 
During the splitting 2 new tags are added to the children collection of 
the parent. Those 2 new tags represent "splitted node" and for that reason 
they have exactly the same name and attributes as the original:

>>>
   TagNode part1 = new TagNode(null, getQName(), getAttributes());
   TagNode part2 = new TagNode(null, getQName(), getAttributes());
<<<

Now we have 3 "equal" HTML tags and the original tag has to be removed. Of 
course first found is the one that is going to be removed. But the tags 
reside in this order: <part before split> <part after split> <original>. 
So instead of the original the <part before split> is removed and now the 
original contains part of the nodes from <part after split>. Those nodes 
are duplicated as the result.

Notice, that the reason for this bug is the same as for the original 
statement in Issue 8.

Original issue reported on code.google.com by anastass...@businesswire.com on 21 Apr 2009 at 8:40

GoogleCodeExporter commented 9 years ago

Original comment by anastass...@businesswire.com on 21 Apr 2009 at 10:38

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by anastass...@businesswire.com on 25 Apr 2009 at 12:24