//
ImportantDate impdate = dtelement.addNewImportantDate();
//Creating value for <holiday> element
Calendar holiday = new XmlCalendar("2004-07-04");
//Creating value for <fun-begin-time> element
Calendar funbegintime = new XmlCalendar("10:30:33");
//Creating value for <fun-end-time> element
Calendar funendtime = new XmlCalendar("12:40:12");
//Creating value for <birthdatetime> element
Calendar birthdatetime = new XmlCalendar("1977-11-29T10:10:12");
//Creating value for <job-duration> element
GDuration jobduration = new GDuration(1,2,4,5,10,12,15,null);
//Creating value for <payday> element
Calendar payday = new XmlCalendar("---12");
//Setting all the elements
impdate.addHoliday(holiday);
impdate.setFunBeginTime(funbegintime);
impdate.setFunEndTime(funendtime);
impdate.setJobDuration(jobduration);
impdate.setBirthdatetime(birthdatetime);
impdate.setPayday(payday);
impdate.setDescription("Using XmlCalendar");
//
// add another important date using Calendar
//
impdate = dtelement.addNewImportantDate();
//Creating value for <holiday> element using XmlCalendar
holiday = new XmlCalendar("2004-07-04");
//Creating value for <fun-begin-time> element using GregorianCalendar
funbegintime = Calendar.getInstance();
funbegintime.clear();
funbegintime.set(Calendar.AM_PM , Calendar.AM);
funbegintime.set(Calendar.HOUR, 10);
funbegintime.set(Calendar.MINUTE, 30 );
funbegintime.set(Calendar.SECOND, 35 );
//Creating value for <fun-end-time> element
funendtime = Calendar.getInstance();
funendtime.clear();
funendtime.set(Calendar.AM_PM , Calendar.AM);
funendtime.set(Calendar.HOUR, 12);
funendtime.set(Calendar.MINUTE, 40 );
funendtime.set(Calendar.SECOND, 12 );
//Creating value for <birthdatetime> element
birthdatetime = Calendar.getInstance();
birthdatetime.clear();
birthdatetime.set(1977,10,29,10,10,12);
//Creating value for <job-duration> element
jobduration = new GDuration(1,2,4,5,10,12,15,null);
//Creating value for <payday> element
payday = Calendar.getInstance();
payday.clear();
payday.set(Calendar.DAY_OF_MONTH,12);
//Setting all the elements
impdate.addHoliday(holiday);
impdate.setFunBeginTime(funbegintime);
impdate.setFunEndTime(funendtime);