Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Comparison of XML files ignoring ordering of child elements

by RonW (Parson)
on Jan 24, 2019 at 00:16 UTC ( #1228895=note: print w/replies, xml ) Need Help??


in reply to Comparison of XML files ignoring ordering of child elements

One of the method would be to convert XML into text and than comparing text files

FYI, XML is text. If you expect the 2 XML files to be ordered and formatted identically, a simple text diff will work just fine. If you need to allow for formatting differences, you could filter the XML files through a "shallow parser", for example XML::Parser::REX, then do a text diff on the resulting files. But, this will only "normalize" the formatting of the tags. The content of attribute values and any "bare text" in a container element is left "as is". Any format normalizing of that content is outside the scope of XML.

  • Comment on Re: Comparison of XML files ignoring ordering of child elements

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1228895]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2019-04-24 03:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I am most likely to install a new module from CPAN if:
















    Results (121 votes). Check out past polls.

    Notices?