• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compare Two DOM Objects

 
Rajesh Savitri
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have two Dom objects from two different xml docs. Both the xml docs are of same Schema. But the contents of the two objects could be Same/Diff/Node might be in diff order. I need to compare these two objects and identify if they are same or diff. Can Some one tell me the best approach for this.
eg:
<root>
<node1/>
<node2/>
</root>
<root>
<node2/>
<node1/>
</root>
Even though the nodes 1 and 2 are in diff order the data are similar in these two xml docs. So when I compare the result shd be "Both xml docs are equal"
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should check if <XmlUnit/> would have a suitable API for your needs.
 
Rajesh Savitri
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic