We find that two parsed ASTs often don't compare equal because the attributes/namespace declarations are in a different order. The order of attributes should be irrelevant - https://www.w3.org/TR/REC-xml/#sec-starttags
This seems to caused by the attributes/namespacedecs being stored in a Seq:
final case class Element(attributes: Seq[Attribute] = Seq.empty, children: Seq[Node] = Seq.empty, namespaceDeclarations: Seq[NamespaceDeclaration] = Seq.empty)
Could this be solved by using a Map? For instance:
final case class Element(attributes: Map[ResolvedName, String] = Map.empty, children: Seq[Node] = Seq.empty, namespaceDeclarations: Map[String, String] = Map.empty)
I guess this looses the use of the explict Attribute and NamespaceDeclaration types but is worth the tradeoff IMHO
Possibly related to #7
We find that two parsed ASTs often don't compare equal because the attributes/namespace declarations are in a different order. The order of attributes should be irrelevant - https://www.w3.org/TR/REC-xml/#sec-starttags
This seems to caused by the attributes/namespacedecs being stored in a
Seq
:Could this be solved by using a
Map
? For instance:I guess this looses the use of the explict
Attribute
andNamespaceDeclaration
types but is worth the tradeoff IMHO