Is there a way to define equality on Xml statements such that these three are the same (ignoring whitespaces and arguments and tags order)?
1:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com</groupId>
<url>http://maven.apache.org</url>
</project>
2:
<project>
<modelVersion>4.0.0</modelVersion>
<url>http://maven.apache.org</url>
<groupId>com</groupId>
</project>
3:
<project>
<modelVersion>4.0.0</modelVersion>
<url>http://maven.apache.org</url>
<groupId>com</groupId>
</project>
For example, xml isn’t helpful because there is no Eq instance on Content.
Also, xml-conduit is not usable too, because Element contains all node elements in List. Also it’s sensitive to whitespaces.
There are many libraries to work with xml including HXT but It’s hard to find something usable.
Parse the XML into some structure similar to:
This reduces the problem to equality on sets and strings.