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
  • 37,735
  • 57
  • 182
  • 278

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
  • 322
  • 2
  • 16
  • 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