Questions tagged [xmlunit-2]

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.

69 questions
1
vote
0 answers

Using XMLUnit to compare xml

I am trying to compare two xml files with attributes and child elements regardless of the xml tag order. I am using XMLUnit for same. I created a diff using mentioned code and was expecting that it will say it's similar. But actually it's giving…
Kuleen
  • 11
  • 1
1
vote
1 answer

XmlUnit ignore order of elements when comparing XML files

I have the two following xml files:
GBP
burm87
  • 768
  • 4
  • 17
1
vote
2 answers

Comparing two XMl files ignoring element and attribute order Java eclipse

Iam new to this field and has been assigned with a challenging task. I have 2 XML files (namely Test1 & Test 2 as mentioned below). And i need to compare these xml files using java and return boolean value as true if there are no differences.And…
user988904
  • 31
  • 4
1
vote
1 answer

XMLUnit - different element selector for duplicate element names

I,m using XMLunit for comparing XMLs.i have xmls as below. 56482 ererr name1 value1 name2
Mohamed Rafiudeen
  • 147
  • 1
  • 2
  • 7
1
vote
2 answers

XMLUNIT How do I ignore multiple elements when comparing XML?

I am able to compare 2 xml files using XMLUNIT 2.5 DiffBuilder. I want to ignore certain elements using withNodeFilter. But the withNodeFilter accepts only 1 element. Is there a way to ignore more that one element for comparison.…
Ben
  • 195
  • 2
  • 10
1
vote
1 answer

Compare two xml's using XMLUnit bypassing the order of elements

I am writing a comparison util which lets me compare similarity of two xmls without considering the order. Am using xmlunit 2.4.0 org.xmlunit.diff.Diff diff = DiffBuilder.compare(xml1) .withTest(xml2) …
paulophoenix
  • 89
  • 1
  • 10
1
vote
2 answers

XMLDiff / XMLUnit - Ignore Child Order & use of wildcards

I am currently struggling with an issue when comparing 2 xmls - original and reference for differences. The trouble is when I try to apply wildcards for comparison with different child order - additionaly those childs may have different number of…
codi89
  • 11
  • 2
1
vote
1 answer

XMLUnit 2 DiffBuilder ignoreComments() raises exception with Saxon HE

The following simple example demonstrates the problem: import org.xmlunit.builder.DiffBuilder; import org.xmlunit.builder.Input; import org.xmlunit.diff.ComparisonControllers; import org.xmlunit.diff.DefaultNodeMatcher; import…
Miklos Krivan
  • 1,732
  • 20
  • 14
1
vote
1 answer

xmlunit: Error with ElementSelectors.conditionalBuilder

So I have the following input, expected output and actual output xml: input.xml Main Contact & No Reported To 1/6/2017 11:25:45 AM
jbailie1991
  • 1,305
  • 2
  • 21
  • 42
1
vote
0 answers

how to select particular nodes to assert using xml unit

I am comparing the xml files for a component . There I have some nodes which i need to compare. But I dont need all the nodes to be compared. So i there any way in xmlunit so that I can compare only those particular nodes. I use nodefilter and…
1
vote
1 answer

Ignore all elements not present in the test XML with XMLUnit

In XMLUnit 2.x, can I ignore all elements in the actual ("control") XML that are not present in my test ("expected") XML? Example: Actual: 123 456 789 Test: 456 xxx I would want to detect the difference in
jhyot
  • 3,733
  • 1
  • 27
  • 44
1
vote
0 answers

Comparing two XML Strings

I am having 2 XML documents as…
1
vote
1 answer

XML comparison using XMLunit not working when elements are reordered

I have two XMLs Niklaus WirthMark TwainO.-J.…
ashes
  • 13
  • 5
1
vote
1 answer

Compare subnodes in XMLUnit 2 - Expected child 'node2' but was 'null'

I need to compare XML files using XMLUnit 2 where xml subnodes can differ in order. Due to the underlying libraries that are used I can't influence order of subnodes. For comparison I am using:
ksokol
  • 8,035
  • 3
  • 43
  • 56
0
votes
0 answers

Compare Part of XML using XMLUNIT ignoring nodes and attributes

laser printer common table, round 1m storage
Ankit
  • 1