ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-xml
perl-xml
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved