Menu

XMLUnit Diff error

2003-02-05
2003-02-05
  • Salim Djaffar

    Salim Djaffar - 2003-02-05

    I was finally able to use xmlunit by recompiling in JDK1.3.1.
    For some of the simple xmls it works great, but for  some it fails.
    The error:

    org.custommonkey.xmlunit.Diff [different] Expected number of child nodes '2' but was '5' - comparing <Envelope...> to <Envelope...>

    junit.framework.AssertionFailedError: org.custommonkey.xmlunit.Diff
    [different] Expected number of child nodes '2' but was '5' - comparing <Envelope...> to <Envelope...>

    at org.custommonkey.xmlunit.XMLTestCase.assertXMLEqual(XMLTestCase.java:208)
    at org.custommonkey.xmlunit.XMLTestCase.assertXMLEqual(XMLTestCase.java:280)
    at test.wamu.transformation.uia.alltel.TestAlltelToUIADocumentResponse.testTranslateMessage(TestAlltelToUIADocumentResponse.java:50)

    Any possible hint ?

    Thanks,
    Salim Djaffar

     
    • Jeff Martin

      Jeff Martin - 2003-02-05

      Looks like it might be a white space thing.

      <element>  stuff   </element> is three nodes where as <element>stuff</element> is one.

      Have you tried turning on ignore whitespace

       
    • Salim Djaffar

      Salim Djaffar - 2003-02-05

      Yes, you're right.
      Setting the ignore whitespace to true saves the day.
      Thanks much.

       

Log in to post a comment.

MongoDB Logo MongoDB