Menu

Node matching with Chain ElementSelectors

MonishaM
2018-10-03
2018-10-07
  • MonishaM

    MonishaM - 2018-10-03

    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();

     

Log in to post a comment.

MongoDB Logo MongoDB