It's likely this is another ICU/lax issue.

But I'd like to see the specific error that this gets, and the remaining 
properties that are in effect, e.g., the lengthKind is of particular importance 
here.

My point is that Daffodil/DFDL does not use the calendarXYZZY properties to 
determine the length of the xs:date element. The length is determined only 
based on the lengthKind and that this is representation 'text' (I assume).

The resulting text string, once isolated based on length properties, is only 
subsequently then interpreted into an xs:date using the dfdl:calendarXXX 
properties.

So if you add whitespace after this date, and those characters are included 
into the Birthday element text representation based on its lengthKind, then 
yes, I agree this is about ICU and lax mode not being sufficiently lax.

But I'd like to see the error message and rest of the surrounding DFDL schema 
to confirm.




________________________________
From: Steve Lawrence <slawre...@apache.org>
Sent: Wednesday, August 19, 2020 1:34 PM
To: users@daffodil.apache.org <users@daffodil.apache.org>
Subject: Re: Bug in Daffodil?

Like with numbers, we use ICU for parsing calendars. It seems this is
another case of ICU and and DFDL describing different behaviors for
lenient/strict mode. With numbers, ICU decided that lax behavior is not
tightly specified, and so we can't really depend on a particular
behavior. I suspect the same goes for calendars. I think the DFDL-WG is
working to make that change in the final revision so that DFDL it makes
this more clear.



On 8/19/20 1:22 PM, Roger L Costello wrote:
> The spec says this for calendarCheckPolicy:
>
> Additional lenient parsing behaviour when in 'lax' mode:
>
>        Leading and trailing whitespace
>        in the data but not in the pattern
>        is accepted
>
> The following element declares a lax policy:
>
> <xs:element name="Birthday" type="xs:date"
>     dfdl:calendarCheckPolicy="lax"
>     dfdl:calendarPatternKind="explicit"
>     dfdl:calendarPattern="yyyy:MM:dd"
>     dfdl:calendarFirstDayOfWeek="Sunday"
>     dfdl:calendarDaysInFirstWeek="5"
>     dfdl:calendarTimeZone="UTC+6"
>     dfdl:calendarLanguage="en"
> />
>
> Daffodil reports an error if I put whitespace following this date:
>
> 1970:11:06
>
> The spec says that whitespace should be allowed with a lax policy. I believe 
> this is an error in Daffodil. Do you agree?
>
> /Roger
>

Reply via email to