I have encountered a wiered JAXB parsing issue. I am using JAXB RI 2.x. I have enabled the schema validation using "unmarshaller.setSchema(schema)". However, if the XML contains an empty element, JAXB does not throw any validation error. So the clients are happily passing empty string values!!
Here is how the element is declared in the schema:
(Please see my comments below)
Here is how it appears in the XML instance:
(Please see my comments below)
Even though it is a required field, it is successfully validated by JAXB. How do I enable the rejection of such empty elements?
Thanks