Page 1 of 1

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

Posted: Fri Feb 12, 2016 3:22 pm
by tatra603
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

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

Posted: Fri Feb 12, 2016 5:05 pm
by florin
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

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

Posted: Fri Feb 12, 2016 9:07 pm
by HomeGoods
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.

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

Posted: Mon Feb 15, 2016 5:43 pm
by tavy
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

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

Posted: Mon Feb 15, 2016 6:09 pm
by tatra603
[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

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

Posted: Tue Feb 16, 2016 12:35 pm
by tavy
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

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

Posted: Thu May 05, 2016 9:30 am
by tavy
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

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

Posted: Tue Feb 14, 2017 2:30 pm
by Walter
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

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

Posted: Tue Feb 14, 2017 5:21 pm
by adrian
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

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

Posted: Tue Feb 14, 2017 6:22 pm
by Walter
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

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

Posted: Tue Feb 14, 2017 7:01 pm
by adrian
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

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

Posted: Tue Mar 14, 2017 5:09 pm
by george
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