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
0
votes
0 answers

XMLUnit 2.3 and ignoring comparaison in some tag

I'm comparing two xml in soapUi (Groovy) and I want to ignore some tags (not just one) I tried this solution below but didn't work : def ExpectedString = 'Expected Xml' def ResponseString ='XML SoapResponse to compare' Diff diff =…
Hamza Amami
  • 94
  • 4
  • 21
0
votes
1 answer

Matching nested elements with different order and number format

I'm using xmlunit 2.2.1 with Java and have the following XMLs to match. The problem here is twofold: the order is not the same some of the numerical values may have trailing zeroes (e.g. 0.250000) For this reason ByNameAndTextRecSelector() doesn't…
Roland
  • 7,525
  • 13
  • 61
  • 124
0
votes
1 answer

XMLUNIT Namespace exception when comparing XML files

I have 2 XML files and when comparing them using XMLUNIT, I get the below exception. Exception in thread "main" org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to…
Purus
  • 5,701
  • 9
  • 50
  • 89
0
votes
1 answer

Compare XML ignore child order

I have googled for this and I know there are like 10 other questions like this but I can't seem to get it to work.. I want to compare 2 xml strings and only get the differences in spelling errors or stuff like that, while ignoring child order. This…
BananaBackend
  • 95
  • 1
  • 1
  • 13
0
votes
1 answer

How to disable XMLUnit DTD validation?

I am trying to compare two XHTML documents using XMLUnit 2.2.0. However, it is taking too long. I guess the library is downloading DTD files from Internet. How can I disable DTD validation? I am using the following test code: public class Main { …
Fernando Costa
  • 669
  • 1
  • 9
  • 31
0
votes
1 answer

Assert Xml document against schema, so document must contains all schema's elements

Using NUnit and XMLUnit.NET I have two test which validate generated Xml document against the schema First one testing only required elements Public Sub GenerateXmlDocument_WithOnlyRequiredElements_SuccesfullyValidated() Dim factory As…
Fabio
  • 31,528
  • 4
  • 33
  • 72
0
votes
1 answer

comparing two xmls using xmlunit ignorng their order

I have two xml files which I need to compare using xmlunit content of these xml files are always same except their order ex:
user3540481
  • 221
  • 3
  • 13
0
votes
1 answer

Can't register namespace with XMLUnit

I can't seem to work out how to set namespace when comparing XML's using xmlunit-2 Tried like: @Test public void testDiff_withIgnoreWhitespaces_shouldSucceed() { // prepare testData String controlXml = "Test…
learnAndImprove
  • 1,339
  • 4
  • 15
  • 25
1 2 3 4
5