Re: Alternative URL template proposal

On 11/9/07, Joe Gregorio <joe@bitworking.org> wrote:
> On Nov 9, 2007 9:26 PM, DeWitt Clinton <dewitt@unto.net> wrote:
> >   http://example.com/{categories+/}
> >   http://example.com/uri/atom/search
>
> I believe the grammar is ambiguous. For example,
> if I have the template:
>
>    http://example.com/{name1,name2+}
>
> And
>    name1 := "fred"
>    name2 := "barney"
>
> Does that expand to:
>
>    http://example.com/fred+barney
>
> or
>
>    http://example.com/fred&barney

http://example.com/fred&barney

Because:

  <separator> ::=  <unreserved-char> | "(" <ungrouped> ")"

And "+" is a reserved char.    If you wanted the "+", you'd need:

  http://example.com/{name1,name2(+)}


> There are also escaping issues. For example,
> what if I want to emit ')' as part of a prefix?

You can't.  It's not possible in my current proposal.

However, you could simply put the "()" before the template in the URL.

  http://example.com/(perens){foo?}

I'd love to see a reasonable use-case where the () are necessary in
the prefix.  If they are exceedingly rare then I'd be okay living
without them...


For the record, I'm generally +1 on your last draft.   I think it works well.

-DeWitt

Received on Saturday, 10 November 2007 03:22:23 UTC