Jitesh,
Which example are you using, the basic FieldHandler or GeneralizedFieldHandler?
Try both, you may get different results. I think with the GeneralizedFieldHandler it won't output the xsi:type.
--Keith
Kalyani Jitesh wrote:
Hi there,
I am trying the custom field handler for date field as shown in,
http://castor.exolab.org/xml-fieldhandlers.html
It is working fine. But it is adding "xsi:type" attribute to <date> element,
When marshalling.
e.g. <date xsi:type="java:java.lang.String">2005/01/27 16:43:23</date>
I have suppressed generating xsi:type attribute by below method
marshaller.setSuppressXSIType(true);
But I am getting following error during un-marshal,
unable to add text content to date due to the following error: java.lang.Illegal
StateException: Invalid dateTime format: 2005/01/27 16:51:46{file: [not availabl
e]; line: 5; column: 37}
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:671)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:565)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:748)
at org.openuri.order.Order.unmarshal(Order.java:134)
at OReader.main(OReader.java:15) .
My question is can we not avoid attribute, xsi:type="java:java.lang.String" in date element, and still un-marshal the xml to Java Object?
Please reply.
Thanks and Regards,
Jitesh
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user
