W3C home > Mailing lists > Public > ietf-http-wg@w3.org > October to December 2011

(wrong string) €“ Invalid example?

From: Mark Nottingham <mnot@mnot.net>
Date: Wed, 26 Oct 2011 09:51:05 +1100
Cc: ietf-http-wg@w3.org
Message-Id: <F0E263D5-9693-43EA-9589-571F74894663@mnot.net>
To: Hkan <hakan.canberger@gmail.com>
Hi Hkan,

Sending an e-mail to the list is fine. Our resident ABNF experts will have a look and get back to you as soon as possible. Thanks for taking the time to send feedback.

Cheers,


On 26/10/2011, at 7:19 AM, Hkan wrote:

> Hi.
> 
> I'm new to all this, so I'm sorry if I'm not following protocol (not sure if I should open an Issue Ticket or start by mailing the group first)
> 
> 
> I've found examples that do not add up in p1-messaging 1.2.1.  ABNF Extension: #rule
> 
> >   For compatibility with legacy list rules, recipients SHOULD accept
> >   empty list elements.  In other words, consumers would follow the list
> >   productions:
> >
> >     #element => [ ( "," / element ) *( OWS "," [ OWS element ] ) ]
> >
> >     1#element => *( "," OWS ) element *( OWS "," [ OWS element ] )
> ...
> >  For example, given these ABNF productions:
> >
> >     example-list      = 1#example-list-elmt
> >     example-list-elmt = token ; see Section 3.2.3
> >
> >   Then these are valid values for example-list (not including the
> >   double quotes, which are present for delimitation only):
> >
> >     "foo,bar"
> >     " foo ,bar,"
> >     "  foo , ,bar,charlie   "
> >     "foo ,bar,   charlie "
> 
> token is defined as 1*tchar and tchar is one character from a set of visible character. Since space is not a tchar, token cannot contain a space.
> 
> In the second example " foo, bar,", since token cannot contain spaces, I cant see how a space can be the first character. Given that I've read the ABNF correctly, the only allowable first character is "," or a tchar. The only way a space can come before token is if it's following a comma ",". So this would be valid: ", foo ,bar,"
> The same problem exists in example 3 as well,
> 
> If we look at example 3 and example 4 they end with spaces. That's not allowed. According to the rules they may only end on a tchar or ",".
> 
> I'm guessing the rules are correct, so the first and last spaces in example 2-4 should be removed.
>      "foo,bar"
>      "foo ,bar,"
>      "foo , ,bar,charlie"
>      "foo ,bar,   charlie"
> 
> 
> I hope I didn't get this completely wrong.
> 
> Hkan Canberger
> 

--
Mark Nottingham   http://www.mnot.net/
Received on Tuesday, 25 October 2011 22:51:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 06:51:49 GMT