Diff Files and Dirs: Add Ignore Element order for XML documents
Are you missing a feature? Request its implementation here.
-
- Posts: 83
- Joined: Fri Sep 17, 2004 10:53 am
- Location: Prague, the Czech Republic, Europe
Diff Files and Dirs: Add Ignore Element order for XML documents
Hello,
I would like to ask You to add a feature to Diff Files and Dirs. When perfoming diff of XML documents, I would like to be able to check Ignore Element order in the same style as Ignore Attribute order now.
Use case: The comparsion of XML documents produced by e. g. GUI, which saves XML output in different Elements order when just for example position of GUI's nodes are changed.
I already consulted it by Octavian on XML Prague 2016.
Thank You in advance, Stepan
I would like to ask You to add a feature to Diff Files and Dirs. When perfoming diff of XML documents, I would like to be able to check Ignore Element order in the same style as Ignore Attribute order now.
Use case: The comparsion of XML documents produced by e. g. GUI, which saves XML output in different Elements order when just for example position of GUI's nodes are changed.
I already consulted it by Octavian on XML Prague 2016.
Thank You in advance, Stepan
-
- Posts: 56
- Joined: Wed Jan 05, 2011 10:36 am
Re: Diff Files and Dirs: Add Ignore Element order for XML documents
Hello,
I've just filed a new improvement request on our internal issue tracking system to add the possibility to ignore the order of the elements, similar to what already is done for attributes.
You'll be notified when this feature will be available.
Best Regards,
Florin
I've just filed a new improvement request on our internal issue tracking system to add the possibility to ignore the order of the elements, similar to what already is done for attributes.
You'll be notified when this feature will be available.
Best Regards,
Florin
Florin Avram
<oXygen/> XML Editor
<oXygen/> XML Editor
-
- Posts: 22
- Joined: Fri Nov 14, 2008 8:21 am
Re: Diff Files and Dirs: Add Ignore Element order for XML documents
Hi Florin, out of curiosity (and because I could very well need this feature): Did your feature request make it to market? I use oxygen file diff v18 but do not seem to be able to diff xml files such that the change of order of neighbouring xml elements is not considered to be a difference. Cheers, Aaron.
-
- Posts: 56
- Joined: Wed Jan 05, 2011 10:36 am
Re: Diff Files and Dirs: Add Ignore Element order for XML documents
Hello,
No, the feature is not available.
In the latest iterations to Diff tools, our developers concentrated on adding diff support between documents presented in the Author editing mode.
From what I know, implementing the requested feature is not a too easy job to do and there is no estimation about when it could be available.
Best regards,
Florin
No, the feature is not available.
In the latest iterations to Diff tools, our developers concentrated on adding diff support between documents presented in the Author editing mode.
From what I know, implementing the requested feature is not a too easy job to do and there is no estimation about when it could be available.
Best regards,
Florin
Florin Avram
<oXygen/> XML Editor
<oXygen/> XML Editor
-
- Posts: 1
- Joined: Wed May 29, 2019 7:59 am
Re: Diff Files and Dirs: Add Ignore Element order for XML documents
Post by fireundubh »
It's actually pretty easy. I wrote a dirty hack in Python. My original brute-force approach:
- Allow the user to define an attribute or set of attributes that comprise the unique "signature" of each element tag.
- Generate element collections by recursively iterating through the elements of Documents A and B.
- Loop 1: Iterate through the B collection, generating a list of comparable elements from the A collection.
- Loop 2 (nested in L1): In each iteration of L1, iterate through the comparable elements, comparing each attribute value across A and B.
- Loop 3 (nested in L2): In each iteration of L2, collect a list of differences.
- In L2, print the result for that element (e.g., the element address in the tree, keys, and values) and break.
edit: I've made a lot of improvements to my approach since late Tuesday. Here's what the output of my tool looks like:

-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: Diff Files and Dirs: Add Ignore Element order for XML documents
Hello,
Thanks for your suggestion.
The comparison algorithms that we are using in Oxygen are very complex, in not a simple thing to ignore elements order. Anyway, we can change the algorithms to ignore the elements order, but this is not the only challenge, then we need to present the differences somehow in editor. The differences are presented in Oxygen side-by-side, and it is very possible that you will have cross changes. For example, one modification in bottom of the left document to be mapped to a modification in the right that is at the end of the document, and one from the end of the left document mapped to one modification from the bottom of the right editor..
Maybe one solution that we can provide more easily would be to rearrange the order of the elements in the editor based on the values of a specified attribute. We can make the "Format and Indent" action to sort the elements in a specific order.
Regards,
Octavian
Thanks for your suggestion.
The comparison algorithms that we are using in Oxygen are very complex, in not a simple thing to ignore elements order. Anyway, we can change the algorithms to ignore the elements order, but this is not the only challenge, then we need to present the differences somehow in editor. The differences are presented in Oxygen side-by-side, and it is very possible that you will have cross changes. For example, one modification in bottom of the left document to be mapped to a modification in the right that is at the end of the document, and one from the end of the left document mapped to one modification from the bottom of the right editor..
Maybe one solution that we can provide more easily would be to rearrange the order of the elements in the editor based on the values of a specified attribute. We can make the "Format and Indent" action to sort the elements in a specific order.
Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service