I tried to write a test case in JUnit for comparing two xml files. Using xmlunit, I should be able to find all the differences. But while comparing, I'm getting false all the time, though I am giving similar kind of files. Timestamp is different for each xml file. So, though all the other contents in xml file are equal, it is returning false. Please provide me any proper way to handle this problem.
I need to ignore the timestamp tag in the xml file when comparing two xml files. And how do I ignore self closing tags?
<XML>
<TIMESTAMP>KALA</TIMESTAMP>
<B>JIHN</B>
<C>Lion</C>
</XML>
<XML>
<TIMESTAMP>QWER</TIMESTAMP>
<B>JIHN</B>
<C NAME =LION/>
</XML>
<B>JIHN</B>