(also handy info for using with the git difftool)
- http://superuser.com/questions/79920/how-can-i-diff-two-xml-files
- http://www.w3.org/TR/xml-c14n
- https://groups.google.com/d/msg/git-users/Wou2d9ovZPo/1CHY9VxNAdgJ
- http://www.manageability.org/blog/stuff/open-source-xml-diff-in-java/view
- http://useless-factor.blogspot.com/2008/01/matching-diffing-and-merging-xml.html
Use the git-difftool(1): git difftool -x './diff-xmllint-c14n $LOCAL $REMOTE'
diff-xmllint-c14n.sh
#!/bin/bash
# git difftool helper for viewing textfile XML diffs
diff -u <(xmllint --c14n $1) <(xmllint --c14n $2)
A bit more sophisticated using the git built-in color mechanism:
#!/bin/bash
l=$(mktemp /tmp/temp.local.XXXX)
r=$(mktemp /tmp/temp.local.XXXX)
xmllint --c14n $1 > $l
xmllint --c14n $2 > $r
git diff --color-words --no-index $l $r
rm $l $r