Subject: Re: [RFC2445] Discrepancy in 4.3.6 Duration (original and May 10th draft)

From: [email-masked]
Date: Fri, 11 May 2001 15:13:06 -0400

coral wrote on 05/11/2001 01:06:58 PM:
> Per the ABNF provided in 4.3.6, P7W as stated directly above is not
> valid - 1*DIGIT "W" is satisfied, but the "T", "H", "M", "S", and "D"
> are also required.  I would propose changing the section to:
> 
>         dur-value  = (["+"] / "-") "P" (dur-date / dur-time / dur-week)
> 
>         dur-date   = dur-day [dur-time]
>         dur-time   = "T" (dur-hour / dur-minute / dur-second)
>         dur-week   = *1DIGIT "W"
>         dur-hour   = *1DIGIT "H" [dur-minute]
>         dur-minute = *1DIGIT "M" [dur-second]
>         dur-second = *1DIGIT "S"
>         dur-day    = *1DIGIT "D"
> 
> This allows P7W, P15DT5H0M20S, and P15DT4H10S as valid durations.

Actually your "1*" change to "*1" makes the last 2 examples illegal.  They 
could ONLY have 0 or 1 digit so "15D" is bad since it has 2 digits.  Same 
for all the other cases subcomponents.

If you are trying to 'simplify' the ABNF so that you can have "PT10M" (ie: 
no "0H") then this proposal wont do it.  You would eliminate the need for 
a "0" in front of the "H" but you would be left with "PTH10M" instead. Not 
too helpful and kinda confusing.   If you intend to make it so that 
dur-hour is optional in a dur-time, thats not how it would parse out.  Im 
not sure if this just a misunderstaning on how to parse the format or if 
there is a goal that is not being expressed so my simple mind can grok 
it...

Bruce
===========================================================================
Bruce Kahn                                INet: [email-masked]
Iris Associates                          Phone: 978.392.5335
Westford, MA, USA 01886                    FAX: and nothing but the FAX...
Standard disclaimers apply, even where prohibited by law...

---

From: "coral" <[email-masked]>
Date: Sat, 12 May 2001 10:08:42 -0700

> Actually your "1*" change to "*1" makes the last 2 examples
> illegal.  They could ONLY have 0 or 1 digit so "15D" is bad
> since it has 2 digits.  Same for all the other cases subcomponents.

Argh. Still new to ABNF.  Thank you for the corrections, in the previous
message as well.  They make more sense now - I thought that ( a / b / c )
required all of {a,b,c} in any order, not any of {a,b,c}.

> If you are trying to 'simplify' the ABNF so that you can have "PT10M"
> (ie: no "0H") then this proposal wont do it.  You would eliminate the
> need for a "0" in front of the "H" but you would be left with "PTH10M"
> instead.  Not too helpful and kinda confusing.   If you intend to make
> it so that dur-hour is optional in a dur-time, thats not how it would
> parse out.  Im not sure if this just a misunderstaning on how to parse
> the format or if there is a goal that is not being expressed so my
> simple mind can grok it...

Definitely a misunderstanding on how to write ABNF on my part.

So, what would be the correct ABNF that would allow the following durations
as valid?

P4DT7H
P1WT1M1S
P1W
PT23H59M
PT0H0M59S
P0WT0H1M
P0W0DT0H0M1S
P1W1D
P1W1DT1M

And how would that ABNF accomodate zero-value durations - "PT"? "PT0S"?

Zero-value durations don't appear to be prevented by the RFC, and I'd like
to be able to handle a request for a zero-value duration if the user of our
Net::ICal module requested it (or reject it with an explanation of why the
RFC prevents it).

coral

---

From: John Stracke <[email-masked]>
Date: Thu, 17 May 2001 10:25:15 -0400

[email-masked] wrote:

> If you are trying to 'simplify' the ABNF so that you can have
> "PT10M" (ie: no "0H") then this proposal wont do it.

I believe the current ABNF permits it, actually, because:

...and 10M matches dur-minute.

--
/=================================================================\
|John Stracke    | http://www.ecal.com |My opinions are my own.   |
|Chief Scientist |================================================|
|eCal Corp.      |In the country of the blind, the one-eyed man is|
[email-masked]|in therapy.                                     |
\=================================================================/

---

From: "coral" <[email-masked]>
Date: Thu, 17 May 2001 07:32:09 -0700

> ...and 10M matches dur-minute.

So, this leaves us with "PT10M" and "P1W" valid?  Great!

I'll continue using PT0S for zero durations, it seems the most
useful of the possibilities.

coral