Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Comparing two XML files using XMLDiff.diff()

883051Aug 18 2011 — edited Aug 21 2011
Hi,

I tried to compare two XML files using XMLDiff.diff() method. I gave the following as Inputs to this method:
XMLDoc1:
<Root>
<Child>
<sub-child1> name<sub-child1>
</child>
<Root>

XMLDoc2:

<Root>
<Child>
<sub-child1> name<sub-child1>
<sub-child2>place<sub-child2>
</child>
<Root>

These two XML docs are differing with element <sub-child2>place<sub-child2>. But the diff() method is returning false(i.e the two XML docs are same). If I interchange the Inputs (i.e XMLDoc1 as XMLDoc2 and viceversa) then diff() is returning True and getDiffString() is showing the difference.

Can you please help me?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2011
Added on Aug 18 2011
4 comments
2,526 views