0

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!

Mathias
  • 3,879
  • 5
  • 36
  • 48
  • @vtd-xml-author if there is a sample of simple one or two-liner with indentation, maybe you can add a link? – StaxMan May 15 '18 at 14:30
  • 1
    I looked at VTD, but didn't use it. 1. seemed more complex to use 2. not updated since 2015 3. site was a mess 4. no examples matched my usecase – Mathias May 16 '18 at 08:02

0 Answers0