Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JiBX Exception: Missing 'T' separator in dateTime  RSS feed

 
raju sangam
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I need to parse date value from the xml file. pls see the below date value mention in xml file.
<Exchange date="2008-03-18" />

I had tried change type as String and date, still I'm facing the same exception.

can anyboby suggest, how to parse date value into java object. would be great help.

Thanks,
Raju
 
Alexey Romanchuk
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Raju !

I can suggest you to use a custom deserializer (see, Jibx docs).

1. Put a format element to your mapping, for instance,


2. Then, use the format for your attribute


3. Finally, you need to write a body for 'JiBXHelper.deserializeDate', something like this :


( Or, use a thread-safe wrapper for SimpleDateFormat - com.thoughtworks.xstream.converters.basic.ThreadSafeSimpleDateFormat )


Of course, maybe more simple solution exists, but I hope this will help you.

Alexey.
 
Rajasekhar Sana
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can simply map date field as follows:

<value name = "date" style = "attribute" field = "dateField" format = "SqlDate.default"/>

Refer URL for more info. -

http://jibx.sourceforge.net/details/conversions.html

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!