Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我熟悉忽略属性值的差异,但是完全按名称忽略属性的正确方法是什么?如何使这两个文档评估为相似?
文件1:
<a attributeName="value"></a>
文件2:
<a></a>
这最终为我工作。(如果有其他解决方案,请告诉我)
DiffBuilder.compare(control.withTest(test) .checkForSimilar() .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byName)) .ignoreWhitespace() .withAttributeFilter(a -> !"attributeName".equals(a.getName())) .build();