Diff Files and Dirs: Add Ignore set of nodes defined by the XPath for XML documents

Are you missing a feature? Request it's implementation here.
tatra603
Posts: 72
Location: Prague, the Czech Republic, Europe

Diff Files and Dirs: Add Ignore set of nodes defined by the XPath for XML documents

Fri Feb 12, 2016 3:22 pm

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 specify the set of nodes using their XPath definitions, which, the nodes, will be ignored. And I should be able to save this set of nodes for future re-use.

Use case: The comparsion of XML documents produced by e. g. GUI, which differ ony by timestamp, user names etc.

I already consulted it by Octavian on XML Prague 2016.

Thank You in advance, Stepan
florin
Posts: 54

Re: Diff Files and Dirs: Add Ignore set of nodes defined by the XPath for XML documents

Fri Feb 12, 2016 5:05 pm

Hello,

I've just filed a new improvement request on our internal issue tracking system to add the possibility to ignore the nodes matching XPath expressions specified by the user.

You'll be notified when this feature will be available.

Best Regards,
Florin
Florin Avram
<oXygen/> XML Editor
HomeGoods
Posts: 87

Re: Diff Files and Dirs: Add Ignore set of nodes defined by the XPath for XML documents

Fri Feb 12, 2016 9:07 pm

I too would welcome this feature.
Currently I use Araxis Merge for it. But its expression filter is regexp-based; a bit fragile and not so much helpful.
tavy
Posts: 152

Re: Diff Files and Dirs: Add Ignore set of nodes defined by the XPath for XML documents

Mon Feb 15, 2016 5:43 pm

Hi,

Thanks for feedback.
Yes, the possibility to ignore the nodes using XPath expressions when comparing documents it is useful in many cases.
I think it will be an XPath subset not the full XPath, but will solve most of the use cases.

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
tatra603
Posts: 72
Location: Prague, the Czech Republic, Europe

Re: Diff Files and Dirs: Add Ignore set of nodes defined by the XPath for XML documents

Mon Feb 15, 2016 6:09 pm

[quote="tavy"]it will be an XPath subset not the full XPath[/quote]

Hi, can You give us an example of what You mean by "an XPath subset not the full XPath"? So we can provide a feedback, if provided improvement would help us. Thank You, Stepan
tavy
Posts: 152

Re: Diff Files and Dirs: Add Ignore set of nodes defined by the XPath for XML documents

Tue Feb 16, 2016 12:35 pm

Hi Stepan,

By an XPath subset I mean that you will not be able to use a full XPath 2.0 for example, maybe some of the functions will not be supported. But we will see this when will be implemented and we can discuss about it. The feedback is always welcome.

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
tavy
Posts: 152

Re: Diff Files and Dirs: Add Ignore set of nodes defined by the XPath for XML documents

Thu May 05, 2016 9:30 am

Hello,

In oXygen XML Editor 18 we added support in Diff Files tool to ignore nodes using an XPath expression.
An XPath panel was added on the toolbar of the File Comparison tool and in the Compare view in the Syncro SVN Client. You can enter an XPath 2.0 expression to ignore certain nodes when comparing using the XML Fast or XML Accurate algorithms.

Watch this video demonstration to find out more more about "XML Three Way Diff" in Oxygen XML Editor 18:
https://www.youtube.com/watch?v=3wLmNZq ... e=youtu.be

For more details see the "Compare Files" section from our use manual:
http://oxygenxml.com/doc/versions/18.0/ ... rison.html

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Walter
Posts: 2

Re: Diff Files and Dirs: Add Ignore set of nodes defined by the XPath for XML documents

Tue Feb 14, 2017 2:30 pm

Hello,
I have a special need in comparing 2 XML files. I just installed a demo of Version 18.1 because I saw this new feature.
The problem I have with it, is, that I can ignore a xml-node ONLY in the view of the file.
My scenario is, that a have an old version of an xml file on the left side. This old xml includes a node, that is not in the new file on the right.
When I want to merge the new text differences from the new file on the right into the old file on the left, the ignored node in the left file is actually not ignored, it is deleted. This is a pitty :( . Is there not a way to keep it?
Greetings
Walter
adrian
Posts: 2454

Re: Diff Files and Dirs: Add Ignore set of nodes defined by the XPath for XML documents

Tue Feb 14, 2017 5:21 pm

Hi,


When I want to merge the new text differences from the new file on the right into the old file on the left, the ignored node in the left file is actually not ignored, it is deleted. This is a pitty :( . Is there not a way to keep it?
I cannot obtain the situation you are describing.
1. How are you merging the differences? What action(s) are you using?
2. What XPath are you using?

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Walter
Posts: 2

Re: Diff Files and Dirs: Add Ignore set of nodes defined by the XPath for XML documents

Tue Feb 14, 2017 6:22 pm

Hello Adrian,

the easiest way to explain me is via a small example:

File on the left:
<document>
<par class="Verstext"><verszahl>1</verszahl> <k>a</k>Geschlechtsregister<k>1</k> Jesu Christi, <k>b</k>des Sohnes Davids, <k>c</k>des Sohnes Abrahams.</par>
</document>

File on the right:
<document>
<par class="Verstext"><verszahl>1</verszahl> Geschlechtsregister Jesu Christi, des Sohnes Davids, des Sohnes Abrahams.</par>
</document>

In the xml diff options I can use the "Ignore node through xpath" and insert "/document/par/k".
If I do that, there is no difference marked on screen in the files when I perform the compare.
When I change the last word in the right file from Abraham to Sara, and restart the compare, a change is marked.
But when I want to transfer the change from the right file to the left (to change Abraham to Sara on the left file), the whole line is changed, which means "my" ignored nodes are deleted. But I want to keep them!

Hopefully I explained this well.

Greetings
Walter
adrian
Posts: 2454

Re: Diff Files and Dirs: Add Ignore set of nodes defined by the XPath for XML documents

Tue Feb 14, 2017 7:01 pm

Thank you,

I can reproduce the problem with the example you have provided. I'm afraid that's a bug.
I've logged this to our issue tracking tool to be analyzed and resolved. We will notify this thread when a bugfix becomes available.

I don't have a workaround for this. Configuring the Diff to ignore changes in Text (Options > Preferences, Diff / Files Comparison, "XML Diff") is one way, but that defeats the purpose of the Diff.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
george
Site Admin
Posts: 2100

Re: Diff Files and Dirs: Add Ignore set of nodes defined by the XPath for XML documents

Tue Mar 14, 2017 5:09 pm

Hi Walter,

We analyzed the issue, which was registered as EXM-38671, and there is not much that can be done, I am afraid.
To understand better the situation, here it is an example:

Code: Select all

<p>abcd<k>ignored</k>xyzw</p>


and let's say this is compared to

Code: Select all

<p>ab123zw</p>


What should oXygen do when you want to copy from right to left? Where should 1, 2 and 3 go, before or after the k element, if that is preserved in the initial document? As you can see, there are more possible answers.
In this case, the diff basically says the content of p is changed and the copy from right to left will replace the content of p. The solution to get your desired behavior is to manually merge the changes.

I hope this clarifies things.

Best Regards,
George
George Cristian Bina

Return to “Feature Request”

Who is online

Users browsing this forum: No registered users and 0 guests