marshalling code marshals the JAXB Object without a root element
The schema below results in marshalled JAXB Object without a root element:
generated (marshalled) xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
Of course unmarshalling fails with the "[org.xml.sax.SAXParseException: unexpected root element (uri:" exception.
From reading other posts it's become clear that one way to resolve this is to annotate the generated Java code with an @XmlRootElement. Indeed it works.
But - does this imply I have to edit the xjc generated code everytime I run xjc? There must be a better way, no?
thanks for any help on this...