[DFDL-WG] Clarification when calendarPattern is a superset of the type
Steve Lawrence
slawrence at tresys.com
Tue Jan 22 12:10:55 EST 2013
Assume we have the following element:
<xs:element name='date' type='xs:date' dfdl:calendarPattern='yyyy-MM-dd
hh:mm' />
So we have a element of type xs:date, but a calendarPattern that
specifies date and time formatting symbols. What should happen in this
case? Two potential options that I see (there are probably others):
1) Throw some kind of error, signifying that calendarPattern contains
formatting symbols not allowed for the type.
2) Truncate the parsed data to fit the type, so the data
2013-01-22 11:59
becomes
<date>2013-01-22</date>
This seems reasonable, however the spec mentions the following:
When unparsing, and property calendarPattern contains a formatting
symbol that requires a component of the date/time and the infoset
value does not contain that component, it is a processing error.
So that means it is impossible to unparse when the calendar pattern is a
superset of the element type. Is this ok?
Thoughts?
- Steve
More information about the dfdl-wg
mailing list