01 May 2009, 12:52
Generic-user-small

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
Generic-user-small

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")
fileOut.println(writer.toString())
fileOut.close()
  You must be logged in to comment