Is there a way to control groovy's MarkupBuilder's output and filter out the newline characters? I have code like below:
import groovy.xml.MarkupBuilder
def writer = new StringWriter()
def xml = new MarkupBuilder(writer)
xml.basket(){
fruit (type:"apple", 1)
fruit (type:"orange", 2)
}
which invariably outputs:
<basket>
<fruit type='apple'>1</fruit>
<fruit type='orange'>2</fruit>
</basket>
I'd really like it in a single line:
<basket><fruit type='apple'>1</fruit><fruit type='orange'>2</fruit></basket>