Monday, March 9, 2009

JAXB printing xs:date as xs:datetime

For xs:date element, the automatic xml it created for a java date object came out as a datetime element. I tried to use custom binding but this didn't work. Hack I found around it was

tripDate.clear();
tripDate.setDay(cloneDate.getDay());
tripDate.setMonth(cloneDate.getMonth());
tripDate.setYear(cloneDate.getYear());
tripType.setTripDate(tripDate);

It then printed it out correctly

No comments: