> For example you quote "Any change in the sequence is to be ignored."
> That is definitely something that I wouldnt consider "right"
> for a general purpose tool ( I would want to know  if  Doc 1
> is "A,B" and doc2 is "B,A" ).
> And is that 2 modifications or 2 deletes and 2 inserts?

If the tool would optimize right, it would detect one 'move' (which is 1 delete 
+ 1 insert of something identical). But it takes a lot of brute force to 
optimize all such identified changes.

> I've used various XML Diffs in various tools and libraries
> and was never quite happy with any of them.
>
> But OTOH, having a public domain algorithm implemented in
> pure XQuery would be *awesome*.

I guess pretty much every XML Editor has it's own XML Diff feature somewhere. 
The Arbortext Editor had one that could be used separately from commandline, 
which worked well enough for our purposes. It was called aptdiff, not sure it 
is still available..

There is also a more straight-forward algorithm that I used for doing 
deep-equals in XSLT 1. It should be fairly easy to convert it to XQuery. It is 
not a very smart algorithm, so A,B versus B,A would be seen as a diff between 
first child and the second child. You can find it here: 
http://xsltunit.org/xsltunit.xsl

Kind regards,
Geert


drs. G.P.H. (Geert) Josten
Consultant


Daidalos BV
Hoekeindsehof 1-4
2665 JZ Bleiswijk

T +31 (0)10 850 1200
F +31 (0)10 850 1199

mailto:[email protected]
http://www.daidalos.nl/

KvK 27164984

P Please consider the environment before printing this mail.
De informatie - verzonden in of met dit e-mailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to