How to compare two xmls that have the same content but different attribute orders?
scala> val xml1 = <a method="1" href="2" ref="3" onclick="4">Hello</a> xml1: scala.xml.Elem = <a ref="3" href="2" onclick="4" method="1">Hello</a> scala> val xml2 = <a ref="3" href="2" onclick="4" method="1">Hello</a> xml2: scala.xml.Elem = <a href="2" ref="3" onclick="4" method="1">Hello</a> scala> xml1 == xml2 res8: Boolean = false As a sample, xml1 and xml2 have the same content, but the attributes have different orders, and the result is false . So how to compare such xmls?
+4
1 answer