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 Yishay Weiss other posts by this author
Sep 18 2005 12:05AM messages near this date
view in the new Beta List Site
Re: is there a way to check if one xml document is contained in another? | Out of Office
& XSLT Thanks, that does look much closer to what we need. Looks like the namespace 
declarations can be filtered out with a simple s/<reg-exp> //g operation, for 
our purposes we won't be worried about name space collisions. Attribute 
order siginificance is a problem. In fact, in our special case, we're not 
even interested in element order. So we might end up somehow sorting src and 
dst documents (xsl?) and feeding the sorted two to XML::DifferenceMarkup.

Or it might turn out easiest to implement our own small utility.

Regards,
Yishay


> From: Vaclav Barta <vbar@[...].cz>
> To: "Yishay Weiss" <yishayjobs@[...].com>, 
> perl-xml@[...].com
> Subject: Re: is there a way to check if one xml document is contained in 
> another?
> Date: Fri, 16 Sep 2005 16:12:14 +0100
> 
> Hi,
> 
> [shameless plug] For your example, XML::DifferenceMarkup (available on 
> CPAN)
> produces
> 
> <?xml version="1.0"?>
> <dm:diff xmlns:dm="http://www.locus.cz/XML/DifferenceMarkup">
>    <a>
>      <dm:insert xmlns:dm="http://www.locus.cz/XML/DifferenceMarkup">
>        <b name="A"/>
>      </dm:insert>
>      <dm:copy xmlns:dm="http://www.locus.cz/XML/DifferenceMarkup" 
> count="3"/>
>    </a>
> </dm:diff>
> 
> Sorry about the redundant namespace declarations (removing them via
> XML::LibXML proved more painful than rewriting the code in C++), but you
> don't have to look at them: I'd consider the first input file to be a 
> subset
> of the second one iff there's no dm:delete element in the output, which
> should be easy enough to test programatically... There might be 
> pathological
> cases where that test gives a "wrong" answer, but I can't think of any 
> right
> now - if you come across any, let me know.
> 
> 	Bye
> 		Vasek
> 


_______________________________________________
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