/**
* Parse a duration
*/
public void parseDuration() throws Exception {
String duration = "P123Y456M789D";
Duration d = XMLUtil.parseXsdDuration (duration);
assertTrue (d.getYears() == 123);
assertTrue (d.getMonths() == 456);
assertTrue (d.getDays() == 789);
assertTrue (d.getHours() == 0);
assertTrue (d.getMinutes() == 0);
assertTrue (d.getSeconds() == 0);
duration = "P123Y456M789DT987H654M321.123S";
d = XMLUtil.parseXsdDuration (duration);
assertTrue (d.getYears() == 123);
assertTrue (d.getMonths() == 456);
assertTrue (d.getDays() == 789);
assertTrue (d.getHours() == 987);
assertTrue (d.getMinutes() == 654);
assertTrue (d.getSeconds() == (float)321.123);
duration = "PT1M0.1S";
d = XMLUtil.parseXsdDuration (duration);
assertTrue (d.getYears() == 0);
assertTrue (d.getMonths() == 0);
assertTrue (d.getDays() == 0);
assertTrue (d.getHours() == 0);
assertTrue (d.getMinutes() == 1);
assertTrue (d.getSeconds() == (float)0.1);
}