Page 1 of 1

Ignore a difference in a XML tag

Posted: Fri Oct 07, 2016 3:45 am
by Edmondo
Evaluating ExamDiff Pro

How can I set a default to ignore a difference in a XML tag?

For Example:

<CREDAT>20161007</CREDAT><CRETIM>121059</CRETIM>
<CREDAT>20161007</CREDAT><CRETIM>128203</CRETIM>

I do not want to be noticed about a difference in the value between <CRETIM> and </CRETIM>

Re: Ignore a difference in a XML tag

Posted: Fri Oct 07, 2016 10:11 am
by psguru
This is not XML-specific but you can ignore parts of lines (see Options | Text Compare) using a regular expression. In your case you can try something like this:

<CRETIM>.*</CRETIM>

Re: Ignore a difference in a XML tag

Posted: Sun Oct 09, 2016 9:27 am
by MudGuard
careful, * is greedy - better use
<CRETIM>.*?</CRETIM>
(i.e. the non-greedy *? instead of the greedy *)
this handles the case that there are more than one CRETIM elements on a line.

Re: Ignore a difference in a XML tag

Posted: Sun Oct 09, 2016 11:18 pm
by Edmondo
Thank you both for your reply. I used <CRETIM>.*?</CRETIM> which works perfect.