holmes
holmes

Reputation: 981

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,

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.

Upvotes: 5

Views: 680

Answers (2)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799110

XMLStarlet has a canonicalization mode (c14n).

Upvotes: 2

Mitch Wheat
Mitch Wheat

Reputation: 300719

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

The XML Diff and Patch GUI Tool

Upvotes: 1

Related Questions