Remove 'standalone="yes"' from generated XML

Johan Pelgrim picture Johan Pelgrim · Nov 10, 2008 · Viewed 101k times · Source

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"?>

Answer

so_mv picture so_mv · Nov 1, 2010

in JAXB that is part of JDK1.6

marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);