|
[text/plain 2.5k]
On Sat Apr 01 01:56:00 2006, CLOTHO wrote:
> I've looked at the code a little more deeply, and have created a
patch
> that fixes the problem. The following diagnostic shows where the
error
> comes from:
>
> use XML::SemanticDiff;
> use Data::Dumper;
> my $diff = XML::SemanticDiff->new();
> for my $file ('derived.xml', 'orig.xml') {
> print "$file\n";
> print " $_\n" for keys %{$diff->read_xml($file)};
> }
>
> % perl showdoc.pl
> derived.xml
> /LocalPresentationManifest[1]
> /LocalPresentationManifest[1]/Properties[1]/TimeZone[1]
> /LocalPresentationManifest[1]/Properties[1]/TimeZone[1]/Description[1]
> /LocalPresentationManifest[1]/Properties[1]/TimeZone[1]/Identifier[1]
> /LocalPresentationManifest[1]/Properties[1]/TimeZone[1]/Abbreviation[1]
> /LocalPresentationManifest[1]/Properties[1]/Description[1]
> /LocalPresentationManifest[1]/Properties[1]/TimeZone[1]/Name[1]
> /LocalPresentationManifest[1]/Properties[1]
> orig.xml
> /LocalPresentationManifest[1]
> /LocalPresentationManifest[1]/Properties[1]/TimeZone[1]
> /LocalPresentationManifest[1]/Properties[1]/TimeZone[1]/Description[2]
> /LocalPresentationManifest[1]/Properties[1]/TimeZone[1]/Abbreviation[1]
> /LocalPresentationManifest[1]/Properties[1]/TimeZone[1]/Identifier[1]
> /LocalPresentationManifest[1]/Properties[1]/TimeZone[1]/Name[1]
> /LocalPresentationManifest[1]/Properties[1]/Description[1]
> /LocalPresentationManifest[1]/Properties[1]
>
>
>
> The key information is the "Description[2]" from orig.xml. It seems
> that the $position_index hash is erroneously only looking at the tag
> name, not the xpath, when incrementing. The attached path uses the
full
> xpath as the key to $position_index.
>
Hi CLOTHO!
Thanks for your input.
I translated your example into a test file, and together with a
modified fix (as applicable to previous modifications) I applied it
into my development line of XML-SemanticDiff here :
http://svn.berlios.de/svnroot/repos/web-cpan/XML-SemanticDiff/trunk/
The changelog message reads:
<<<<<<<<<<<<<
- Applied a modified version of:
http://rt.cpan.org/Ticket/Display.html?id=18491
- Fixes a case where the same tags in different places with
identical contents, are not considered semantically identical.
- Thanks to CLOTHO for reporting it and suggesting a
fix.
- t/11tag-in-different-locations.t
>>>>>>>>>>>>>
Note that this development was not approved by the XML-SemanticDiff
originator. (who has been very unresponsive as of late).
Regards,
Shlomi Fish
|