I ran into a JAXB parsing problem. I am using JAXB RI 2.x. I have enabled schema validation using "unmarshaller.setSchema (schema)". However, if XML contains an empty element, JAXB does not throw any validation errors. Thus, clients happily pass empty string values!
This is how an element is declared in a schema:
(see my comments below)
Here's how it appears in an XML instance:
(see my comments below)
Although this is a required field, it is successfully validated by JAXB. How to enable rejection of such empty elements?
thank
Sunny source
share