Hello, 
 
I'm trying to unmarshall a datetime field. The datetime field however can 
contain a value that is actually invalid according to Castor validation.
Therefore I want to implement a handler which will rewrite the invalid datetime 
to a valid value.
 

Suppose the following xsd:

 

 <xs:element name="Root"> 

  <xs:complexType> 
   <xs:sequence> 
    <xs:element name="CreationDateAndTime" type="xs:dateTime"/> 
   </xs:sequence> 
  </xs:complexType> 
 </xs:element> 

 

Configure a handler in binding.xml: 

 <elementBinding name="/Root/CreationDateAndTime" > 
  <member name="CreationDateAndTime" handler="MyDateHandler"/> 
 </elementBinding> 

 
And try to unmarshall an xml document like:
 
<Root ....> 
   <CreationDateAndTime>2010-03-1T09:57:01+01:00</CreationDateAndTime> 
</Root >
 
The handler is never called as an exception is thrown.
 
Question:
How can I get a date like '2010-03-1T09:57:01+01:00' into a date field?

Greetings,
Huub

Reply via email to