XML Diff: How to generate XML diff using XSLT?

diff, xml, xslt

Solution

Interesting question! I once tried to do something similar involving two XML sources, and my experience was that there just ain't no way.

You could use XSL's facility for including user-built functions, and code up something really slick. But I really can't see it.

If I were to do something like this, I'd process the two XML files in parallel using DOM4J, which lets me easily traverse the code programmatically and do detail sub-queries.

Trying to do this in XSLT will either prove you to be a genius or drive you into madness.

Problem

I would like to compute the diff between two XML files or nodes using XSL/XSLT. Is there any stylesheet readily available or any simple way of doing it?

Original source

Related problems