AA26
6 years agoNew Contributor
How to compare a node value in one xml to similar nodes in another xml
I have 2 XMLs and need to compare the node values.
example:
XML1 has 4 firstname and 4 last name node and same with XML2 but both are not in same order.
I need to make sure that all the 4 names in XML1 match with all 4 in XML2 ( if not first element then looping through remining)
I have tried getNodeValues and am getting the values but not sure on comaparing them.
Can someone please help me as am new to groovy and this is very confusing for me
- Create a sorted list for each <inc> by <desc> element; and each element in the should be a map which contains <desc>, <date> and their values as key, value pairs. Do the same for xml2. Then compare both the lists.
Should come something like:
xml1 = [ [desc: 'abc', date: '111'], [desc: 'def', date:'222']]
xml2 should also be same.