Ignore a difference in a XML tag

General questions about using ExamDiff Pro, ideas for new features, bug reports, and usage tips.
Post Reply
Edmondo
New Member
Posts: 2
Joined: Fri Oct 07, 2016 3:38 am

Ignore a difference in a XML tag

Post 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>
User avatar
psguru
Site Admin
Posts: 2228
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: Ignore a difference in a XML tag

Post 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>
psguru
PrestoSoft
MudGuard
Expert Member
Posts: 69
Joined: Mon Jun 07, 2004 12:42 am

Re: Ignore a difference in a XML tag

Post 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.
Edmondo
New Member
Posts: 2
Joined: Fri Oct 07, 2016 3:38 am

Re: Ignore a difference in a XML tag

Post by Edmondo »

Thank you both for your reply. I used <CRETIM>.*?</CRETIM> which works perfect.
Post Reply