nicolas de loof wrote: > I also am realy surprized the type converter that receives an invalid String > from XML Stream for an expected date doesn't throw an exception or even logs > an error. This is not just about validating the schema, but about conversion > error...
This is the responsibility of the JAXB runtime, and as far as I can tell it's correct according to the JAXB spec (section B.3.8): B.3.8.1 Unparseable Data for Simple types If simple type data cannot be parsed into a java datatype, then the value of the java datatype must not change the current set value. An access to the datatype must return the value as specified in Section B.3.8.2 [...] B.3.8.2 Missing element information item This case arises when an element declaration required by a XML schema is missing from the XML instance. Property or field access must return the value specified in Section B.3.8.4 [...] B.3.8.4 Value for missing elements/attributes If an attribute or an element is missing from an XML instance, then unmarshal will not change the current set value. An access to the property will return the set value or if unset, the uninitialized value. The uninitialized value of the property or field depends upon it's type. If the type is [...] 3. a reference (must be mapped to a simple type) - value is null. Ian -- Ian Roberts | Department of Computer Science [email protected] | University of Sheffield, UK
