From: Stefan B. <bo...@ap...> - 2015-05-10 10:41:44
|
Hi all I'm still experimenting with ways to make it easier to write (or combine) custom ElementSelectors. It occured to me it might be useful for an ElementSelector to not only know the Elements it is supposed to evaluate but also their position inside the respective documents. In the branch https://github.com/xmlunit/xmlunit/tree/two-arg-element-selector I've modified the signature to be boolean canBeCompared(Element controlElement, XPathContext controlXPath, Element testElement, XPathContext testXPath); which also meant I had to modify NodeMatcher's interface. The branch still isn't complete - ElementSelectors#byXPath doesn't properly provide the XPathContexts for the NodeMatcher it uses internally - but close enough to ask for comments now. Unless anything significant happens, I should be able to complete the branch today. Is this a good idea or am I just adding complexity without gaining too much? Any feedback is more than welcome Cheers Stefan [In case you've been following along: I cherry-picked some refactorings from and then rebased the branch, sorry for the noise.] |