Handling XMLElement nillable like JAXB · Issue #89 · FasterXML/jackson-dataformat-xml (original) (raw)

I cant find any way to make Jackson serialize the typical "xsi:nil"-Attribute that is defacto standard to represent NULL-Values in XML? Please correct me if i see this wrong ;-)

In JAXB this can be done easily by annotating a java-variable with: @xmlelement(nillable=true)

see also: http://blog.bdoughan.com/2012/04/binding-to-json-xml-handling-null.html

can/should Jackson do this?


here also a compare of JAXB and Jackson.


so it seems to me that the best way at the moment is not to serialize/deserialize NULL-values but just leave them out. The only bad thing about this is, that empty strings "" can not be represented...