0

I need to compare two files with same tags, but they have some different values and I need to print three lists:

Set<Costo> list1 = read.getCostos("path1");
        Set<Costo> list2 = read.getCostos("path2");

        Set<Costo> list3 = ListaCostoUtil.listaConjunta(list1, list2);
        Set<Costo> plus = ListaCostoUtil.listaComplementoMenos(list3, list2);
        Set<Costo> minus = ListaCostoUtil.listaComplementoMas(list3, list2);

where list1 is my first XML file and list2 is the other, I need to print a list3 where is a complete list of all the elements from list1 and list2.

With list plus I just need to compare my list3 with list2 and throw all the elements that are not on list2 with a "+" and it's the same with minus but just adding a "-", how could I start doing it? thanks

dhilt
  • 18,707
  • 8
  • 70
  • 85
Antonio Alejos
  • 115
  • 1
  • 6
  • 1
    Have you tried https://stackoverflow.com/questions/141993/best-way-to-compare-2-xml-documents-in-java? – Nghia Do Nov 27 '18 at 19:14
  • Do you have an `equals` method in `Costo` class? Please post the `Costo` class –  Nov 27 '18 at 19:15

0 Answers0