How do i reuse parts of XML document with Woodstox writeRaw WITH indentation?

137 views Asked by At

I am writing a pretty large document, with quite a few repeating elements. I don't want to recreate those elements every time, but store them in memory and print them.

I have found other SO threads on this topic, where the answer is to use Woodstox/Stax2 and the writeRaw()-function.

This works fine for me, but i would also like the resulting stream to be pretty printed.

The SO threads discussing that topic all are about using the IndentingXMLStreamWriter - however, there is no such class for WoodStox, so there is no writeRaw-method i can use.

I would like to avoid reading in the entire string in memory, and i have not been able to get it to work.

Pointers appreciated!

0

There are 0 answers