Scala seems to do two things for the XML you enter that make it no less understandable, but make it less readable:
First, it extends tags that close themselves:
scala> <tag/> res109: scala.xml.Elem = <tag></tag>
And secondly, it scrambles the attributes in random order, as if it were putting them in a hash set:
scala> <tag a="a" b="b" c="c" d="d"/> res110: scala.xml.Elem = <tag d="d" a="a" c="c" b="b"></tag>
Together, they conspire to make XML much less readable (at least by me). I am not very familiar with the XML library; is there any way to do an xml-to-string translation that gives a compact readable form? (If not by default, by recursing and writing your own string conversions - or are there too many special cases that are hiding there?)
Rex kerr
source share