gdanenb has asked for the wisdom of the Perl Monks concerning the following question:
Hi I've discovered that using XML::SemanticDiff is a little bit problematic when elements disordered.
Then I switched to XML::SemanticCompare but did not figure out a way to display the output of diff method in xml form.
Could somebody please post an example?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: diff output of XML::SemanticCompare
by toolic (Bishop) on Sep 14, 2011 at 14:04 UTC | |
XML::SemanticCompare but did not figure out a way to display the output of diff method in xml form.Here is a quote from the XML::SemanticCompare POD: an array ref of strings representing the differences found between xml docs is returned. The strings look like XPATH statements but are not actual XPATH statements.How does the diff output vary from your expectation? Show a small snippet of what you get vs. what you expect. If you are expecting the output to be in the form of XML tags, that doesn't seem to be supported, according to my interpretation of the POD. (By the way, I tried installing it, but I gave up due to dependency errors.) XML::SemanticDiff is a little bit problematic when elements disorderedYou could submit a bug report. It is best to create as small a testcase as possible to demonstrate the problem you are having. | [reply] [d/l] |
by gdanenb (Acolyte) on Sep 15, 2011 at 06:47 UTC | |
I've read XML::SemanticCompare POD before using it. I thought that may be there is a way to convert it to xml tags, since I need to display a difference in readable format on screen. Regarding XML::SemanticDiff , I was sure that it's behavior is well known according http://ekawas.blogspot.com/2008_11_23_archive.html If I append new elements to the end of file, it's working great. But if some element is removed from begging of xml it displays a mess... I'd like to know if there is another way to display difference between two xml files... | [reply] [d/l] |
by Anonymous Monk on Sep 15, 2011 at 07:58 UTC | |
I thought that may be there is a way to convert it to xml tags, since I need to display a difference in readable format on screen. Of course there is a way, but you don't specify HOW it should be converted I'd like to know if there is another way to display difference between two xml files... Not using XML::SemanticCompare :) That is the format XML::SemanticCompare uses for comparison of likeness Its practically xpath, and hey, it is human readable, even if WIDE and vague :) its not meant for producing patches
Take a close look at the source, its really not that complicated Esp see XML::SemanticCompare::SAX sub start_element | [reply] [d/l] |
by gdanenb (Acolyte) on Sep 15, 2011 at 12:24 UTC | |
by Anonymous Monk on Sep 15, 2011 at 08:06 UTC | |
Re: diff output of XML::SemanticCompare
by Anonymous Monk on Sep 14, 2011 at 11:32 UTC | |
| [reply] [d/l] |