Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.

X Report information
Id: 39705
Status: resolved
Left: 0 min
Priority: 0/0
Queue: XML-SemanticDiff

Owner: Nobody
Requestors: bskaplou <eshikov [...] mail.ru>
Cc:
AdminCc:

Severity: Wishlist
Broken in: 0.98
Fixed in: 0.98




X History Display mode: Brief headersFull headers
#   Tue Sep 30 06:59:44 2008 bskaplou - Ticket created  
Subject: Exclude some paths from
[text/plain 384b]
I've created small patch which allows to ignore some paths in comparison
it allows to call
my $diff = XML::SemanticDiff->new(ignore_xpath=>['/xml/z']);
And SemanticDiff created in this way will ignore nodes matching xpath
/xml/z during comparison.
It's also possible to give more then one path.
This feature is pretty useful to compare soap:message with timestamp
headers for example
Subject: ignore_xpath.diff

[application/octet-stream 890b]
Message body not shown because it is too large or is not plain text.
#   Tue Sep 30 08:33:54 2008 SHLOMIF - Correspondence added  
[text/plain 750b]
On Tue Sep 30 06:59:44 2008, bskaplou wrote:
> I've created small patch which allows to ignore some paths in
comparison
> it allows to call
> my $diff = XML::SemanticDiff->new(ignore_xpath=>['/xml/z']);
> And SemanticDiff created in this way will ignore nodes matching
xpath
> /xml/z during comparison.
> It's also possible to give more then one path.
> This feature is pretty useful to compare soap:message with timestamp
> headers for example

Hi!

Thanks for your patch. However, it is unusable, as it is. Please
checkout:

http://svn.berlios.de/svnroot/repos/web-cpan/XML-SemanticDiff/trunk/

And use svn diff to prepare the patch. Moreover, you need to include a
few regression tests for the new features under t/.

Regards,

-- Shlomi Fish
#   Tue Sep 30 08:33:56 2008 RT_System - Status changed from 'new' to 'open'  
#   Wed Oct 01 02:43:10 2008 bskaplou - Correspondence added  
From: eshikov[...]mail.ru
[text/plain 878b]
Hello Shlomi,


Thanks,
Boris.

On Tue Sep 30 08:33:54 2008, SHLOMIF wrote:
> On Tue Sep 30 06:59:44 2008, bskaplou wrote:
> > I've created small patch which allows to ignore some paths in
> comparison
> > it allows to call
> > my $diff = XML::SemanticDiff->new(ignore_xpath=>['/xml/z']);
> > And SemanticDiff created in this way will ignore nodes matching
> xpath
> > /xml/z during comparison.
> > It's also possible to give more then one path.
> > This feature is pretty useful to compare soap:message with timestamp
> > headers for example
>
> Hi!
>
> Thanks for your patch. However, it is unusable, as it is. Please
> checkout:
>
> http://svn.berlios.de/svnroot/repos/web-cpan/XML-SemanticDiff/trunk/
>
> And use svn diff to prepare the patch. Moreover, you need to include a
> few regression tests for the new features under t/.
>
> Regards,
>
> -- Shlomi Fish



[application/octet-stream 3.3k]
Message body not shown because it is too large or is not plain text.
#   Wed Oct 01 02:45:01 2008 bskaplou - Correspondence added  
From: eshikov[...]mail.ru
[text/plain 1015b]
Hello Shlomi,

Attached file is svn diff with latest version, it also contains two unit
tests. I've run all existing tests and two new they all passes.

Thanks,
Boris.

On Tue Sep 30 08:33:54 2008, SHLOMIF wrote:
> On Tue Sep 30 06:59:44 2008, bskaplou wrote:
> > I've created small patch which allows to ignore some paths in
> comparison
> > it allows to call
> > my $diff = XML::SemanticDiff->new(ignore_xpath=>['/xml/z']);
> > And SemanticDiff created in this way will ignore nodes matching
> xpath
> > /xml/z during comparison.
> > It's also possible to give more then one path.
> > This feature is pretty useful to compare soap:message with timestamp
> > headers for example
>
> Hi!
>
> Thanks for your patch. However, it is unusable, as it is. Please
> checkout:
>
> http://svn.berlios.de/svnroot/repos/web-cpan/XML-SemanticDiff/trunk/
>
> And use svn diff to prepare the patch. Moreover, you need to include a
> few regression tests for the new features under t/.
>
> Regards,
>
> -- Shlomi Fish



[application/octet-stream 3.3k]
Message body not shown because it is too large or is not plain text.
#   Wed Oct 01 14:07:25 2008 SHLOMIF - Correspondence added  
[text/plain 1.1k]
Hi Boris!

Sorry for the late response - I encountered some technical
difficulties.

On Wed Oct 01 02:45:01 2008, bskaplou wrote:
> Hello Shlomi,
>
> Attached file is svn diff with latest version, it also contains two
unit
> tests. I've run all existing tests and two new they all passes.
>

Some notes on your patch:

1.
{{{
ok($#results == 1, "Two differences in XMLs");
+
+#TEST
+@results = $diff_ignore->compare($xml1, $xml2);
+ok($#results == 0, "Only one difference if /root/el3 is excluded");
}}}

Please compare scalar(@results) using is.

2. In the test files, put the tests inside blocks for localising
everything:

<<<
{
my $diff = XML::SemanticDiff->(...)
}
>>>

3. Use "for my $i (0...)" (with a space after the $i" instead of "for
my $i(0....)" without it.

4. Don't use "STMT if ..." - instead write it as "if ( ... ) {
STMt } "

5.

<<<<
my $ignore = $self->{ignore_xpath};
+ my @ignore = @$ignore;
>>>>

Just do for my $path (@$ignore) - don't declare a variable - @ignore.

6. for my $ref(($from_doc, $to_doc)) - just do "for my $ref
($from_doc, $to_doc)"

7. Finally, this feature needs documentation.

Regards,

-- Shlomi Fish



> Thanks,
> Boris.
>

#   Thu Oct 02 03:06:41 2008 bskaplou - Correspondence added  
From: eshikov[...]mail.ru
[text/plain 1.4k]
Hello Shlomi,

I made style improvements and added few string describing new option to
documentation. Hope this version is better then prev ones.

Regards,
Boris.

On Wed Oct 01 14:07:25 2008, SHLOMIF wrote:
> Hi Boris!
>
> Sorry for the late response - I encountered some technical
> difficulties.
>
> On Wed Oct 01 02:45:01 2008, bskaplou wrote:
> > Hello Shlomi,
> >
> > Attached file is svn diff with latest version, it also contains two
> unit
> > tests. I've run all existing tests and two new they all passes.
> >
>
> Some notes on your patch:
>
> 1.
> {{{
> ok($#results == 1, "Two differences in XMLs");
> +
> +#TEST
> +@results = $diff_ignore->compare($xml1, $xml2);
> +ok($#results == 0, "Only one difference if /root/el3 is excluded");
> }}}
>
> Please compare scalar(@results) using is.
>
> 2. In the test files, put the tests inside blocks for localising
> everything:
>
> <<<
> {
> my $diff = XML::SemanticDiff->(...)
> }
> >>>
>
> 3. Use "for my $i (0...)" (with a space after the $i" instead of "for
> my $i(0....)" without it.
>
> 4. Don't use "STMT if ..." - instead write it as "if ( ... ) {
> STMt } "
>
> 5.
>
> <<<<
> my $ignore = $self->{ignore_xpath};
> + my @ignore = @$ignore;
> >>>>
>
> Just do for my $path (@$ignore) - don't declare a variable - @ignore.
>
> 6. for my $ref(($from_doc, $to_doc)) - just do "for my $ref
> ($from_doc, $to_doc)"
>
> 7. Finally, this feature needs documentation.
>
> Regards,
>
> -- Shlomi Fish
>
>
>
> > Thanks,
> > Boris.
> >




[application/octet-stream 3.9k]
Message body not shown because it is too large or is not plain text.
#   Fri Oct 03 05:53:45 2008 SHLOMIF - Correspondence added  
[text/plain 92b]
Thanks!

This patch is now included in XML-SemanticDiff-0.99 which was uploaded
to CPAN now.
#   Fri Oct 03 05:53:47 2008 SHLOMIF - Status changed from 'open' to 'resolved'