I am creating a massive xml file in Groovy. I'm using StreamingMarkupBuilder because the regular MarkupBuilder runs me out of Java heap space. I'm looking for a way to insert newlines in the StreamingMarkupBuilder or to parse the stream as it is created. I can't write the entire stream to a variable, it's too big. Here's an approximation of what I'm doing:
<FileWriter I created earlier> << new StreamingMarkupBuilder().bind {
Root {
Person()
ID(idVar)
Location(locationMethod())
}
}
Let me know if you have any clarification questions, I'm happy to work with you.