I am trying to generate xml using JAXB While converting object to xml for null values its coming double empty tag like:
<tag></tag>
But i want this output:
</tag>
I tried
@XmlElement(nillable = true)
private String VoyageID;
But output is coming like this:
<VoyageID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
I dont want null policy description. Just want this output:
But i tried to remove extra information xmlns:xsi but i am not able to make it work. I tried using package-info.java also but that namespace url coming in above root element of xml.
<VesselDetails>
<OceanCarrier Code="">
<Vesselname></Vesselname>
<VoyageId></VesselVoyageId>
<PortofEntry></PortofEntry>
</OceanCarrierSCAC>
<VesselDetails/>
I want output like below:
<VesselDetails>
<OceanCarrier Code=" ">
<Vesselname/>
<VoyageId/>
<PortofEntry/>
</OceanCarrierSCAC>
</VesselDetails>