Re: is there a way to check if one xml document is contained in another?
by David Nicol other posts by this author
Sep 6 2005 2:17PM messages near this date
view in the new Beta List Site
is there a way to check if one xml document is contained in another?
|
Re: is there a way to check if one xml document is contained in another?
& XSLT On 9/5/05, Yishay Weiss <yishayjobs@[...].com> wrote:
> my $diff = XML::SemanticDiff->new();
>
> foreach my $change ($diff->compare($src, $dst)) {
> print "$change->{message} in context $change->{context}\n";
> }
>
> output:
> Attribute 'name' has different value in element 'b'. in context /a[1]/b[1]
> Attribute 'name' has different value in element 'b'. in context /a[1]/b[2]
> Attribute 'name' has different value in element 'b'. in context /a[1]/b[3]
> Rogue element 'b' in element '/a[1]'. in context /a[1]
>
> =======
>
>
> All messages except the last I'd like to disregard programatically. Has
> anyone done this? Any ideas?
Well, there's running the output through `grep -v` or its perl equivalent of
something like
foreach my $change ($diff-> compare($src, $dst)) {
$change-> {message} =~ /^Rogue/ or next;
print "$change-> {message} in context $change->{context}\n";
}
--
David L Nicol
sig block blocked by internal administrative order
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Yishay Weiss
David Nicol
Yishay Weiss
Vaclav Barta
Yishay Weiss
|