Utility to LOGICALLY compare two xml files?

Posted by Matthew on Server Fault See other posts from Server Fault or by Matthew
Published on 2012-09-21T14:53:16Z Indexed on 2012/09/21 15:40 UTC
Read the original article Hit count: 154

Filed under:

Right now we are attempting to build golden configurations for our environment. One piece of software that we use relies on large XML files to contain the bulk of its configuration. We want tot ake our lab environment, catalog it as our "golden configuration" and then be able to audit against that configuration in the future.

Since diff is bytewise comparison and NOT logical comparison, we can't use it to compare files in this case (XML is unordered, so it won't work). What I am looking for is something that can parse the two XML files, and compare them element by element. So far we have yet to find any utilities that can do this. OS doesn't matter, I can do it on anything where it will work. The preference is something off the shelf.

Any ideas?

Edit: One issue we have run into is one vendor's config files will occasionally mention the same element several times, each time with different attributes. Whatever diff utility we use would need to be able to identify either the set of attributes or identify them all as part of one element. Tall order :)

© Server Fault or respective owner

Related posts about Xml

Related posts about comparison