Page 1 of 1

editing XML definitions and creating optional comments

Posted: Tue May 18, 2010 8:31 am
by completeRookie
I use some software that generates XML files with the file extension of "xml"

I know that very early in the generated files, there are three lines that I do not care about and I'd like to ignore these lines (if present) whenever comparing.

the first line says
<Export generator="Cache" version="22" zv="Cache for Windows (x86-32) 2009.1.3 (Build 704)" ts="2010-05-18 07:14:00">
and the section in red changes all the time.

the next line
<TimeChanged>61583,39304.928852</TimeChanged>
and once again.
<TimeCreated>61192,45852.879916</TimeCreated>

so the question is, can I tell ExamDiff-pro to ignore comparing any of these lines (if present)

I've tried to be clever, and create another filetype (of xml) but of course, it complains its a pre-defined extension,
I've tried turning off the XML extension, but still no go

so the question of course, can I create any set of rules that ignores these three lines any time they occur

Your help would be appreciated.

Re: editing XML definitions and creating optional comments

Posted: Thu May 20, 2010 12:36 pm
by psguru
You can turn off the XML plug-in (Options | Plug-ins) and ignore lines matching the following regular expression (Options | Compare):

Code: Select all

Export generator|TimeChanged|TimeCreated
Of course, this regex can be tweaked to your needs.

Re: editing XML definitions and creating optional comments

Posted: Fri May 21, 2010 4:52 am
by completeRookie
thanks for the clues where I change the options,
for those that need to do a similar job, I chose to use options - "lines matching regular expression" and inserted the following code.

Code: Select all

^<TimeChanged\b[^>]*>(.*?)</TimeChanged>|^<TimeCreated\b[^>]*>(.*?)</TimeCreated>|^<Export generator(.*?)>
worked absolutely fine, brilliant programme