I'm trying out XStream as a way to quickly serialize objects to Xml or JSON to send over the wire, and deserialize. I do want the XML/JSON to be simple/clean.
It seems to work well, I've added a few aliases, but now I've hit a problem, this code:
println(new XStream.toXML(List(1,2,3)))
produces this XML:
<scala.coloncolon serialization="custom">
<unserializable-parents/>
<scala.coloncolon>
<int>1</int>
<int>2</int>
<int>3</int>
<scala.ListSerializeEnd/>
</scala.coloncolon>
</scala.coloncolon>
I think what is going on is that the Scala List class has its own custom serialization... I wonder if there is a way to override that? I'd prefer to get:
<list>
<int>1</int>
<int>2</int>
<int>3</int>
</list>