Are there any alternatives to XmlUnit?

后端 未结 5 2029
眼角桃花
眼角桃花 2021-01-01 19:33

I need to diff large directory structures containing generated .xml and .wsdl files. The generated .xml files differ in the order that child elements appear. The XmlUnit D

5条回答
  •  温柔的废话
    2021-01-01 19:44

    I have a similar problem, in my case, I had several tags with the same name, but different attributes (the order didn't matter), but XmlUnit always checked first with first, second with second... that could be swapped. My question was:

    Comparing similar xml files with XmlUnit with unordered tags (same tag name with different attributes)

    I found a solution here:

    http://www.infoq.com/articles/xml-unit-test

    In my case, it was solved just overriding the element qualifier:

        Diff diff = new Diff(controlXml, responseXml);
        diff.overrideElementQualifier(new ElementNameAndAttributeQualifier());
    

提交回复
热议问题