Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove 'standalone="yes"' from generated XML

Do you know of a JAXB setting to prevent standalone="yes" from being generated in the resulting XML?

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
like image 746
Johan Pelgrim Avatar asked Nov 10 '08 14:11

Johan Pelgrim


People also ask

What is standalone YES in XML?

Standalone. yes or no. It informs the parser whether the document relies on the information from an external source, such as external document type definition (DTD), for its content. The default value is set to no. Setting it to yes tells the processor there are no external declarations required for parsing the ...

What does standalone mean in XML declaration?

The XML standalone element defines the existence of an externally-defined DTD. In the message tree it is represented by a syntax element with field type XML. standalone. The value of the XML standalone element is the value of the standalone attribute in the XML declaration.


1 Answers

in JAXB that is part of JDK1.6

marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true); 
like image 137
so_mv Avatar answered Sep 30 '22 14:09

so_mv