Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xml diff algorithm #12

Open
2 tasks
albfan opened this issue Feb 7, 2015 · 8 comments
Open
2 tasks

xml diff algorithm #12

albfan opened this issue Feb 7, 2015 · 8 comments
Labels

Comments

@albfan
Copy link
Owner

albfan commented Feb 7, 2015

Use https://github.com/albfan/diffxml project

  • Wrap it's diff output in something understandable by JMeld
  • Create the concept of moves. Code not added or deleted just moved
@albfan
Copy link
Owner Author

albfan commented Jun 13, 2015

Based on this article

http://www.roseindia.net/opensource/xmldiff.php

I have come back to life this projects:

https://github.com/albfan/3dm
https://github.com/albfan/diffmk
https://github.com/albfan/vmtools
https://github.com/albfan/x-diff

there is also a good looking project to test xml output

https://github.com/xmlunit/xmlunit

Hope one of them has the basis for a good xml diffting.

@albfan albfan added the ready label Jan 23, 2016
@albfan
Copy link
Owner Author

albfan commented Jan 24, 2016

This one too https://github.com/albfan/diffxml

This was referenced Jan 24, 2016
@opticyclic
Copy link

XMLUnit is the way to go here.
It has all the options required for allowing you to ignore certain xml attributes.
e.g. Ignore attribute order
http://xmlunit.sourceforge.net/api/org/custommonkey/xmlunit/XMLUnit.html#setIgnoreAttributeOrder%28boolean%29

You can also implement your own versions.

What does the output have to look like in order for JMeld to display it in the GUI?

@albfan
Copy link
Owner Author

albfan commented Jun 2, 2016

By now, diff model is implemented with JMRevision, JMDelta and JMChunk. They represent line changes and word changes

You can see it in action on DiffTree addnodes() function or JMDiff paintDiffs()

It is not a robust implementation (as is line based)

@opticyclic
Copy link

Which branch is that in?

Line based isn't really good enough for XML diff as you can have attributes changing order.
e.g. these are technically the same for XML.

<person gender="female" haircolour="blonde">
  <firstname>Anna</firstname>
  <lastname>Smith</lastname>
</person>

<person haircolour="blonde" gender="female">
  <firstname>Anna</firstname>
  <lastname>Smith</lastname>
</person>

There are lots of other options needed for XML diff too
e.g. ignore child order, namespace, whitespace, comments etc

XmlUnit will also allow you to add your own ignore listeners so you could add one to ignore date time fields for instance.
This is a common requirement when trying to reconcile 2 systems where the timestamps are slightly out.

@albfan
Copy link
Owner Author

albfan commented Jun 3, 2016

There's no such branch. Here's only the research.

Although weak, that model should support a first approach for xml diff.

See tokenizers avaliable (word, char, syntax) for different results with same model.

Move change can the face on second round.

@albfan
Copy link
Owner Author

albfan commented Oct 2, 2016

A rebumped project with working detection of moves -See test suite-

https://github.com/albfan/ssddiff

@albfan
Copy link
Owner Author

albfan commented Apr 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants