Re: Proposal - xmldiff extension
| From: | Anatol Belski | Date: | Sun, 11 Aug 2013 19:46:22 +0000 |
| Subject: | Re: Proposal - xmldiff extension | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-10946@lists.php.net to get a copy of this message | ||
Hi,
On Sat, August 3, 2013 14:26, Anatol Belski wrote:
> Hi,
>
>
> here's the new extension i'd like to propose to be taken into PECL
>
> http://belski.net/phpz/xmldiff-0.7.3.tar.gz
>
>
> Here's the example of how it can work:
>
>
> $from = "<root><a /></root>";
> $to = "<root><b /></root>";
> $xdiff = new XMLDiff\Memory;
>
>
> $diff = $xdiff->diff($from, $to);
> $new = $xdiff->merge($from, $diff);
>
>
> The extension is able to produce diffs of two XML documents and then to
> apply the difference to the source document. Whereby the diff is an XML
> document containing copy/insert/delete instruction nodes and is human
> readable. The diff corresponding to the snippet above would look like
>
> <?xml version="1.0"?>
> <dm:diff
> xmlns:dm="http://www.locus.cz/diffmark">
> <root>
> <dm:delete>
> <a/>
> </dm:delete>
> <dm:insert>
> <b/>
> </dm:insert>
> </root>
> </dm:diff>
>
>
> So far three comparsion possibilities are implemented:
>
>
> - DOMDocument objects
> - local files, based on the pure libxml functionality
> - xml documents in memory, based on the pure libxml functionality
>
>
> Files and memory methods are relatively simple, comparing DOM objects
> would of course require some more resources.
>
> The xmldiff extension is inspired by the perl module DifferenceMarkup,
> which can be found under
>
> http://search.cpan.org/~vbar/XML-DifferenceMarkup-1.04/lib/XML/Difference§6ñ¨÷•œh% Ù‘
> ç0
> Markup.pm
> . The underlaying library libdiffmark is in public domain. It's bundled
> and is used by the xmldiff extension, which itself i'd like to put under
> the BSD license.
>
> Ideas about functionality improvements are highly appreciated.
>
any feedback about this one?
Regards
Anatol