Is there any formal way or known way to canonicalize an xml file to generate diffs?

There seems to be many questions WRT tool to generate diffs between xmls, but there wasn’t this question yet, so anyone who knows this show me a link or paste any example anyone already solved this problem.

Canonicalizing an xml file means,

  • How to find the most similar commit to a modified file?
  • How do I exit the results of 'git diff' in Git Bash on windows?
  • Why doesn't git diff work on the command line for me?
  • Git Diff between HEAD and SVN Master
  • Why does cherry-pick tell me that I have all lines changed?
  • Coloured Git diff to HTML
    • reordering the appearance of attributes
    • reordering the appearance of tags (selectable by command line option)
    • insert line ending(CR/CR+LF/LF) if there isn’t at the end of a close tag
    • insert indentation tab(space)
    • remove redundant spaces and line endings

    And then you can cleanly diff the xml files to see which part was updated.

    I want to use the routine to canonicalize in unix environment, as quick as possible, before checking in to version control repository.

  • git-stitch-import: how to make one master branch?
  • How to make a copy of a remote git branch (without merging with my existing branch)?
  • What git gotchas have you been caught by?
  • Necessity of having license information present in all code revisions
  • is there a way to pipe the git or Mercurial diff output to a GUI Diff tool?
  • SourceTree - Not sure how to go back to a previous commit
  • 2 Solutions collect form web for “Is there any formal way or known way to canonicalize an xml file to generate diffs?”

    XMLStarlet has a canonicalization mode (c14n).

    Instead, you could use the xmldiff tool: Using the XML Diff and Patch Tool in Your Applications

    The XML Diff and Patch GUI Tool

    Git Baby is a git and github fan, let's start git clone.