Hello DFDL community,
After some experimenting, I was able to create some examples of different ways
of textually representing this datetime: 2014-12-01T09:46:40
Here's what I came up with:
December 12, 2014 at 09:46:40
12 Dec 2014, 9:46:40
02014.December.12 AD 09:46:40 AM
All of them parse to this form:
2014-12-01T09:46:40+06:00
Very neat!
Below is my DFDL schema. Truthfully, I don't understand what
dfdl:calendarFirstDayOfWeek="Monday" means. Does it mean that I think of Monday
as the first day of the week? (Who cares what I think) I also don't understand
what dfdl:calendarDaysInFirstWeek="7" means. Does it mean the number of days in
the first week of 2014? What if the input data specified 2015, then my schema
would be wrong, right? /Roger
<xs:element name="input">
<xs:complexType>
<xs:sequence dfdl:separator="%NL;" dfdl:separatorPosition="infix">
<xs:element name="test1" type="xs:dateTime"
dfdl:calendarCheckPolicy="strict"
dfdl:calendarFirstDayOfWeek="Monday"
dfdl:calendarDaysInFirstWeek="7"
dfdl:calendarTimeZone="UTC+6"
dfdl:calendarLanguage="en"/>
<xs:element name="test2" type="xs:dateTime"
dfdl:calendarPatternKind="explicit"
dfdl:calendarCheckPolicy="strict"
dfdl:calendarPattern="MMMM dd',' yyyy 'at' hh:mm:ss"
dfdl:calendarFirstDayOfWeek="Monday"
dfdl:calendarDaysInFirstWeek="7"
dfdl:calendarTimeZone="UTC+6"
dfdl:calendarLanguage="en"/>
<xs:element name="test3" type="xs:dateTime"
dfdl:calendarPatternKind="explicit"
dfdl:calendarCheckPolicy="strict"
dfdl:calendarPattern="dd MMM yyyy',' h:mm:ss"
dfdl:calendarFirstDayOfWeek="Monday"
dfdl:calendarDaysInFirstWeek="7"
dfdl:calendarTimeZone="UTC+6"
dfdl:calendarLanguage="en"/>
<xs:element name="test4" type="xs:dateTime"
dfdl:calendarPatternKind="explicit"
dfdl:calendarCheckPolicy="strict"
dfdl:calendarPattern="yyyyy.MMMM.dd GGG hh:mm:ss aaa"
dfdl:calendarFirstDayOfWeek="Monday"
dfdl:calendarDaysInFirstWeek="7"
dfdl:calendarTimeZone="UTC+6"
dfdl:calendarLanguage="en"/>
</xs:sequence>
</xs:complexType>
</xs:element>
From: Costello, Roger L. <[email protected]>
Sent: Wednesday, June 26, 2019 9:58 AM
To: [email protected]
Subject: Examples of textual representations of dateTime values?
Hello DFDL community,
A couple days ago Steve provided several examples of textual representations of
unsignedInt values, where the text representations are constrained to be
exactly five characters:
54000
9,000
10E04
x:120
All of those represent unsignedInt values and all are exactly five characters.
Neat!
Now I've moved on to textual representations of calendar dates. I am starting
with textual representations of date/time values.
For the xs:dateTime datatype, XML Schemas only allows textual representations
with this form:
'-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?
Here is an example of a textual representation of a dateTime value:
2014-12-01T09:46:40
Would you provide some examples of textual representations of date/time values,
please? Specifically, I seek examples that don't follow the form that XML
Schema requires. It would be great if you could show me alternative ways to
textually represent this date/time value: 2014-12-01T09:46:40
/Roger