Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XMLStreamWriter remove prolog

Tags:

java

xml

stax

I'm writing an xml using XMLStreamWriter. But I do not need the prolog.

<?xml version="1.0" ?>

How can I omit this line in my output xml.

like image 766
Sorter Avatar asked Sep 24 '15 13:09

Sorter


1 Answers

XMLStreamWriter outputs the XML declaration when you call writeStartDocument().

So you can simply skip this call if you don't want to include a XML declaration.

like image 140
wero Avatar answered Oct 05 '22 00:10

wero