I have some XML generated with embedded Scala, but it does not put the generated XML on separate lines.
Currently, it looks like this,
<book id="0">
<author>Gambardella, Matthew</author><publish_date>Sun Oct 01 00:00:00 EDT 2000</publish_date><description>An in-depth loo
k at creating applications with XML.</description><price>44.95</price><genre>Computer</genre><title>XML Developer's Guide</title>
</book>
but I want it to look like this:
<book id="0">
<author>Gambardella, Matthew</author>
<publish_date>Sun Oct 01 00:00:00 EDT 2000</publish_date>
<description>An in-depth look at creating applications with XML.</description>
<price>44.95</price>
<genre>Computer</genre>
<title>XML Developer's Guide</title>
</book>
How can I control the formatting? Here is the code that generates the XML
<book id="0">
{ keys map (_.toXML) }
</book>
here is toXML:
def toXML:Node = XML.loadString(String.format("<%s>%s</%s>", tag, value.toString, tag))