Saturday, October 12. 2013XML Diff and MergeTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
Dear Colleagues,
I have found some issues in this package. I'm using xmldiff package 0.9.2.5.4 ; PHP 5.4.17 Apache 2.2.25. For example I have two xml files: File "from.xml" contains: 321 123 File "to.xml" contains: 123 321 //As I'm using code: $zxo = new XMLDiff\Memory; $dir1 = file_get_contents("upload_IR21/from.xml"); $dir2 = file_get_contents("upload_IR21/to.xml"); $diff = $zxo->diff($dir1, $dir2); /* $zxo = new XMLDiff\Base; $dir1 = dirname(__FILE__) . "/upload_IR21/from.xml"; $dir2 = dirname(__FILE__) . "/upload_IR21/to.xml"; */ $diff = $zxo->diff($dir1, $dir2); $file = 'differences.xml'; file_put_contents($file, $diff); //I get result in differences.xml file: 321 Could you please inform me from where the comes? Also please kindly inform me if there is a method which differs two xml files without matter of xml nodes order?
Hi Paulius,
unfortunately the blog cuts out all the XML stuff you posted, such a sanitizer junkie ![]() But from what I can see you're probably concerned about something you see in the diff. Please note that the diff document contains instructions for syncronizing document A to document B. The node order matters as otherwise we wouldn't know how to merge it. Some XSD schema support were nice to have, whereby i'm still concerned it could lead to the ambiguity in some cases. Please feel free to put such a feature request under bugs.php.net . Thanks.
Dear Anatol,
Yes I see that a lot xml stuff were cutted out from comment. Also I have made some type errors. As I want you to know all the issue, please find it posted clearly in stackoverflow. Here is the link: http://stackoverflow.com/questions/22042195/xmldiff-issues-on-php Thanks a lot for your comments!
Hi Anatol,
Just a quick question, is there any specific way to have the difference file also delete the unchanged records? So it would compare file a with file b, then merge file a with the difference file. But the difference file will contain the following: - Adding of new records - Updating of changed records - Deletion of unchanged records Thanks! |
QuicksearchCategoriesArchives |