0

I am trying to marshal JAXB annotated object into StaX XMLEventWriter, but even when I set marshaller property JAXB_FORMATTED_OUTPUT to true in the result the marshalled object is not formatted.

Thanks

PS: I am using Oracle Java 8 RI and Woodstock Stax

kqr
  • 406
  • 8
  • 12

1 Answers1

0

OK I have found the solution. If I have used XMLStreamWriter, then there is built in wrapper called IndentingXMLStreamWriter, but I could not find same for EventWriter.

Than I found this answer with reference to StaX utils. So I have added to my maven manifest

 <dependency>
    <groupId>net.java.dev.stax-utils</groupId>
    <artifactId>stax-utils</artifactId>
 </dependency>

and was able to use IndentingXMLEventWriter.

Community
  • 1
  • 1
kqr
  • 406
  • 8
  • 12