Clarification when calendarPattern is a superset of the type

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

The answer is 1) it is an error. So the unparsing issue you highlight does not arise. Regards Steve Hanson Architect, Data Format Description Language (DFDL) Co-Chair, OGF DFDL Working Group IBM SWG, Hursley, UK smh@uk.ibm.com tel:+44-1962-815848 From: Steve Lawrence <slawrence@tresys.com> To: <dfdl-wg@ogf.org>, Date: 22/01/2013 17:33 Subject: [DFDL-WG] Clarification when calendarPattern is a superset of the type Sent by: dfdl-wg-bounces@ogf.org 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 -- dfdl-wg mailing list dfdl-wg@ogf.org https://www.ogf.org/mailman/listinfo/dfdl-wg Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
participants (2)
-
Steve Hanson
-
Steve Lawrence