[guest - Thu Aug 1 21:24:17 2002]:
Show quoted text> [guest - Thu Aug 1 21:09:57 2002]:
>
> update on this bug, i put a few print statements in, it looks like
> when this happens the textchecksum is undefined for both the first doc
> and the second.
>
> i looked through the code and couldn't quite see why this was the case.
I've been looking at this myself and I've just figured out why. It's
because you have identically named elements in the same tree.
Following my investigation backwards...
TextChecksum is undefined because it's in a different element to the
expected one. If you insert a call to Data::Dumper of $from_doc and
$to_doc, you can see your element is in two places, one as /element[0]
and one as /element[1].
Going further backwards to find out why this is the case, I looked at
EndTag(). In there, $position_index->{element} is wrongly 0. It turns
out that this is because of some code commented as "reset the element
counter" is setting it to zero.
Looking at the code, it appears that it happens in circumstances like these:
<foo>
<bar>
<foo>oops!</foo>
</bar>
</foo>
I made the warnings go away by using the attached patch, but it's wrong
because it only works in the case of the parent element actually being
in position 1... I'm not sure what the proper fix is. I'll keep
working on it.
XML::SemanticDiff rules as a module, BTW. :-)
-Dom