small medium large xlarge

Back to: All Forums  Groovy Recipes
01 May 2009, 12:52
Brian Oleksa (1 post)

I can easily generate XML with groovy and output it to the groovy console.

def writer = new StringWriter() def xml = new MarkupBuilder(writer) xml.gpx() { wpt(lat:’22.22222’, lon:’77.77777’) } println writer.toString()

But how do I write this to a new file called gps.xml..?

19 Feb 2010, 15:45
John McKown (11 posts)

The same way you’d write anything to a file in Java. Perhaps something like:

def fileOut=new PrintStream("gps.xml")
You must be logged in to comment