0

How to create XSD definition in such a way that JAXB created classes from such XSDs will generate XML with empty XML tag if the field is null.

We can use nillable=true but it adds nil=true data in generated XML. Generated XML should be with clean empty tag element if an element is null.

  • Possible duplicate of [Represent null value as empty element in xml jaxb](https://stackoverflow.com/questions/17366054/represent-null-value-as-empty-element-in-xml-jaxb) – Michał Ziober Mar 23 '19 at 18:12
  • How to embed @XmlCustomizer behaviour in xsd definition? – Sachin Rane Mar 23 '19 at 18:42
  • You need to use [Eclipse MOXy](https://www.eclipse.org/eclipselink/#moxy) and `jaxb:bindings`, for example take a look on [adding an annotation to a JAXB binding class from a schema](https://stackoverflow.com/questions/8702559/adding-an-annotation-to-a-jaxb-binding-class-from-a-schema) – Michał Ziober Mar 23 '19 at 18:46

0 Answers0