Using JAXB (2), you can ensure that null values ββare not sorted as () empty elements. For example,
@XmlRootElement(name = "root")
public class Root {
@XmlElement(name = "name")
protected String name;
}
Currently, if the name is null, I sort
<root>
<name/>
</root>
I would like to create
<root>
</root>
instead.
source
share