Skip to Content
Compare FilesXML Comparison

Comparing XML Files

Comparing XML files is similar to comparing text files: open a file comparison window and load the files, or paste the text, you want to compare.

XML files are text files, and comparing them as such is often enough. Sometimes, however, a text comparison of XML files does not give the result you want because of insignificant differences between the files, such as formatting or attribute order, neither of which affects the content of the XML. And although XML is designed to be human-readable, it is often computer-generated, and many XML generators minimize the number of characters in their output, producing a format that is hard for people to read.

To get the result you want, DeltaWalker Classic offers XML canonicalization. Canonicalization changes an XML document in one or more of the following ways:

  • Encoding of the document in UTF-8
  • Normalization of line breaks to #xA
  • Normalization of attribute values
  • Substitution of character and parsed entity references
  • Removal of the XML declaration
  • Removal of the document type declaration
  • Addition of default attributes
  • Sorting of attributes and namespace declarations

All of this makes the canonical form of XML documents particularly useful for comparison: it eliminates unimportant aspects, such as formatting, and narrows the focus strictly to differences in content. To canonicalize a document, right-click it in the file comparison and choose Canonicalize XML; Prettify XML reformats it instead, one element per line, indented. Both commands change the text in that editor only.

Последна промяна на