0

Is there a library to compare two XML files including all imported XSD files? I need to know differences through the whole tree.

I need to know the individual differences because I need to report on them, not just that the files are different.

jax
  • 36,355
  • 56
  • 177
  • 271

1 Answers1

0

XMLUnit does the trick

    public class XMLComparer extends XMLTestCase {
      @Test
      public void test() {
        String xml1 = "XMLFIle1";//
        String xml2 = "XMLFIle2";//

        XMLUnit.setIgnoreWhitespace(true); // ignore whitespace differences

        // can also compare xml Documents, InputSources, Readers, Diffs
        assertXMLEquals(xml1, xml2);  // assertXMLEquals comes from XMLTestCase
      }
    }
sathya
  • 292
  • 2
  • 15
  • 1
    Hmmm. That just tells you "yes/no". Does not give a list of "differences through the whole tree." – Thilo Jun 21 '16 at 06:14
  • OK , I had a similar demanding situation .I used a clandestine approach to meet the deadline and with no answers to be found . I developed an app to make requests to online XML comparators . – sathya Jun 21 '16 at 06:22