Forum Discussion

AA26's avatar
AA26
New Contributor
6 years ago

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...
  • nmrao's avatar
    nmrao
    6 years ago
    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.