Represent null value as empty element in xml jaxb

I would strongly recommend representing null with either the absence of the node or with the xsi:nil=”true” attribute. This works best with schema validation (i.e. <age/> or <age></age> is not a valid element of type xsd:int. However if you can’t here is how you can accomplish your use case: STANDARD JAXB BEHAVIOUR Using the standard … Read more

JAXB/Moxy Unmarshalling assigns all field values to Map rather than the specific field provided for it

I believe this is somewhat related to the issue: @XmlPath(“.”) conflicts with @XmlAdapter As per bug ticket: org.eclipse.persistence.internal.oxm.record.UnmarshalRecordImpl public XPathNode getNonAttributeXPathNode(String namespaceURI, String localName, String qName, Attributes attributes) { … Line 1279 if(null == resultNode && null == nonPredicateNode) { // ANY MAPPING resultNode = xPathNode.getAnyNode();// by default it return the EventAdapter returing a null … Read more