XML Diff · Tutorial
How to compare two XML configuration files
5 min readbeginnerUpdated
A deployment changed the production settings file, and a tool also reformatted it onto one line. You will compare the old and new versions and see only the settings that actually changed.
What you need
- The XML Diff tool
- The two versions of the file
Steps
Paste both versions
Load the example. The original is indented with a comment; the new version is on one line with attributes in a different order.
Read the differences
With the default options, only real changes appear: the version number, the database host, the pool size, the new-checkout flag and a new dark-mode feature.
− <database host="db1.internal" port="5432"> + <database host="db2.internal" port="5432">Check the options
Untick Ignore attribute order to see how much noise a plain text diff would have shown. Tick it again to get back to the real changes.
Share the result
Press Copy as unified diff and paste it into the deployment ticket.
Try it yourself
Opens the XML Diff with this tutorial's sample loaded.
Common mistakes
- Comparing an invalid file
- A truncated download isn’t well-formed. The message tells you which side and where to look.
- Expecting element order to be ignored
- Element order can matter in XML, so moved elements show as removed and added.
Next steps
Go back to the XML Diff, or keep going with one of these: