Re: is there a way to check if one xml document is contained in another?
by Vaclav Barta other posts by this author
Sep 16 2005 8:09AM 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?
|
Re: is there a way to check if one xml document is contained in another?
& XSLT 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
|