我想知道是否有人知道用于衡量 HTML 等效性的 Java 库?
例如<td class="one two three" name="goat">
将等价于<td name="goat" class="three two one">
. 我想使用 Java 以这种方式比较整个多行 html 字符串。
有什么建议么?
更新:
所以我尝试使用 XmlUnit 的 Diff.similar() 并发现我得到这两个是相似的:
<html three="3" two="2" one="1"></html>
和<html one="one" two="two"></html>
这是不受欢迎的行为......还有其他选择吗?