Haloric has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I have many xml files that I am attempting to compare with either XML::SemanticDiff or XML::SemanticCompare.
Is there a way to get the XML ordered in a consistent way before I start this comparison, without calling out to a separate tool. They both get confused by slight ordering changes
For example, I have elements that are
<sequence name="b" .. <sequence name="a" .. <sequence name="c" ..
I would like them ordered by the 'name' attribute before the comparison starts.
I have looked at XML::LibXML::PrettyPrint but can't make it do what I want.
I can see SemanticDiff copes with missing attributes, but not sure how it would cope with a missing '<sequence name="b" ' element all together without thinking it was a difference in attribute value, rather than entirely missing.
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Consistent xml formatting
by choroba (Cardinal) on Jul 28, 2015 at 14:20 UTC | |
by Haloric (Novice) on Jul 30, 2015 at 09:01 UTC | |
by SimonPratt (Friar) on Jul 29, 2015 at 08:11 UTC | |
by choroba (Cardinal) on Jul 29, 2015 at 09:12 UTC | |
by SimonPratt (Friar) on Jul 29, 2015 at 13:27 UTC |