You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by fl...@ubs.com on 2005/02/10 16:16:19 UTC
use of XmlDate
hi.
I am trying to force a specific format into a date field using the XmlDate. I seem to be generating a proper XmlDate when I debug the object. But the xml itself is always empty
this is my code:
private XmlDate toXmlDate(final Calendar calendar) {
final GDateBuilder builder = new GDateBuilder();
builder.setYear(calendar.get(Calendar.YEAR));
builder.setMonth(calendar.get(Calendar.MONTH)+1);
builder.setDay(calendar.get(Calendar.DAY_OF_MONTH));
final XmlDate xd = XmlDate.Factory.newInstance();
xd.setGDateValue(builder.toGDate());
return xd;
}
Anyone have any suggestion why this is creating seemingly ok XmlDate objects but they are not being picked up when i set them like so
additionalInfo.addNewTermination().xsetDate(toXmlDate(demographics.getTerminationDate()));
Florian Hehlen