Hi!
Am using XML Unit 2.x for a project. Due to the complex Nature of the xmls being evaluated, a single element selector does not seem to be adequate to get the job done.
It appears that the order in which we pass the element selectors to the DefaultNodeMatcher makes a difference. Can anyone please help me understand how the implementation works in this case for multiple Element Selectors? For example, consider the following code snippet -
Hi!
Am using XML Unit 2.x for a project. Due to the complex Nature of the xmls being evaluated, a single element selector does not seem to be adequate to get the job done.
It appears that the order in which we pass the element selectors to the DefaultNodeMatcher makes a difference. Can anyone please help me understand how the implementation works in this case for multiple Element Selectors? For example, consider the following code snippet -
Diff myDiff = DiffBuilder.compare(control).withTest(test)
.withNodeMatcher(new DefaultNodeMatcher(
ElementSelectors.byNameAndAllAttributes,
ElementSelectors.byNameAndAttributes("someattributename"),
ElementSelectors.byNameAndText
))
.checkForSimilar()
.build();
Yes, the order matters as the
ElementSelectors are consulted in the order they have been passed in. Does the example in https://github.com/xmlunit/user-guide/wiki/SelectingNodes#elementselectorsnot-and-or-and-xor give you enough of an idea how things work?