an open source project which enables JUnit-style assertions to be made about the content and structure of XML. XMLUnit 2.x is a complete rewrite and is based on the experience of XMLUnit 1.x.
Questions tagged [xmlunit-2]
69 questions
0
votes
1 answer
XMLUnit NodeFilter not finding difference
Comparing two simple XMLs and want to compare nodes with specific localName. In this case only flowerA. When i use not equals to flowerB it gives me the difference for flowerA node, when i say equals to flowerA it doesnt give any difference?
…

mdev
- 1,366
- 17
- 23
0
votes
0 answers
How to fix "java.io.NotSerializableException" on running remote library function in Jenkins pipeline
I am setting up a Jenkins Pipeline, which calls an external library with a compare XML function written in Groovy that utilises xmlunit.
The function looks as follows:
import java.util.List
import org.custommonkey.xmlunit.*
// Gives you a list of…

Ceesiebird
- 696
- 2
- 11
- 24
0
votes
1 answer
Compare two xml based on the tag as unique tag
I am developing application in which I have to compare 2 xml based on the IPADDRESS tag which is unique.
Ex: input1.xml
20.20.1.20
…

Akshobhya
- 169
- 2
- 16
0
votes
2 answers
How do I map/ignore certain tag when comparing XML?
I'm comparing 2 XML using XMLUnit 2.xx both of them have the same structure except for the root node name :
something
something else
yet another…

user3718160
- 481
- 2
- 11
- 23
0
votes
1 answer
XMLUnit tag containing name attribute not matching
I am using xmlunit 2.5.0.
Below are my two xml string : One is the controlxml and one is testxml.
String controlXml = "

DonSenor
- 3
- 2
0
votes
1 answer
XMLUnit: How to register a self-closing element as different to a non-self-closing element?
I want to compare two empty elements with the same qualified name. I want to be able to specify an option which marks the elements as different if one is self-closing and the other is not.
final String control = "";
final String test =…

Anders Rabo Thorbeck
- 1,126
- 3
- 18
- 28
0
votes
1 answer
Creating excel after finding differences in XML
First of all thanks for this great utility "XMLUnit".
I have a requirement where I want to compare 2 XML's and find the differences. Once the differences are found, I need to generate an excel report which will display the whole XML data (similar…

Ankit
- 900
- 7
- 9
0
votes
1 answer
How to use XMLUnit2 to compare xmls by XPATH?
I am trying to compare two xml only partially using XMLUnit2. I tried below Xpath to compare element int alone. But my test is failed because, it is checking boolean tag as well.
How do I make this test pass?
@Test
public void…

Manoj
- 5,707
- 19
- 56
- 86
0
votes
1 answer
How to compare two XML files ignoring specific tags in java JDK7
I am trying to compare the two XML files where certain tags has to be ignored. How can this be achieved? Since I am using JDK 7, lambda expressions cannot be used.

Fraction
- 3
- 2
- 10
0
votes
2 answers
how to use lambda expression for jdk 7 or older versions
what are the changes that I need to make if I am using jdk 7 and want to use lambda expression?
I am comparing 2 xml files and want to ignore specific nodes hence using this expression
final Diff documentDiff = DiffBuilder
…

Fraction
- 3
- 2
- 10
0
votes
1 answer
XMLUnit - Issue comparing to XMLs that are not in same order
I am using XMLUnit2 to compare 2 XMLs which don't have elements in the same order. I am seeing the below error -
Differences = Expected child 'billingCode' but was 'null' - comparing
at
…

Punter Vicky
- 15,954
- 56
- 188
- 315
0
votes
1 answer
XMLUnit Comparing and Storing Specific Values Related to a Found Difference
I am trying to compare two xml files and if a difference is found between two specific items I want to store a key value that also belongs to that item. For example lets say I have the following two XML files:
File 1:
…

user3443481
- 3
- 1
0
votes
1 answer
XMLUnit how to to ignore missing attribute
I am familiar with ignoring differences in attribute values, but what is the proper way to ignore an attribute by name altogether? How do I make these two documents evaluate as similar?
Doc1:
Doc2:

yellavon
- 2,821
- 12
- 52
- 66
0
votes
1 answer
XMLUnit: removing parent wrapper
Is there a way in XMLUnit 2 to make these two documents return as the same (or similar)? I can do some preprocessing to get the child nodes, but I wanted to see if this could be done directly with XMLUnit.
Doc1:
test
Doc2: …

yellavon
- 2,821
- 12
- 52
- 66
0
votes
1 answer
xml ns attribute to ignore using xml unit
this is my code
Scanner s = new Scanner(new File("ignore.txt"));
final ArrayList list = new ArrayList();
while (s.hasNext()){
list.add(s.next());
}
s.close();
…

Anurag Patro
- 11
- 3