I wanted to compare 2 XMLs, which have the same data but the tag names are different. I need to compare two (input and output) and show the result using JAVA.
eg.
XML 1
<hometown>newyork</hometown>
...
XML 2
<city>newyork</city>
I need to verify that the hometown tag value from XML 1 is same as the city tag value from XML 2.
Does anyone have any suggestions?
Well, I took an approach like, I created a mapping document which says which Tag from input is mapped to which tag in output. Then I parse both input and output XMLs and the converted them into HashMaps (key value pair). Now when I want to compare the value from input XML, I loop through list of inputTags and search the counterpart of the tag from mapping sheet and once I have values for both input and output tag, I compare it and publish the results