W3C home > Mailing lists > Public > uri@w3.org > October 2006

Re: Feedback on draft-gregorio-uritemplate-00

From: Stefan Eissing <stefan.eissing@greenbytes.de>
Date: Sat, 7 Oct 2006 11:45:44 +0200
Message-Id: <C1040DD3-A8D2-4068-AFA0-DF47E928FC7F@greenbytes.de>
Cc: Sam Ruby <rubys@intertwingly.net>, uri@w3.org
To: Mark Nottingham <mnot@mnot.net>

It seems to me that the data type of uri templates parameter would be  
part of the template and not part of the input. The one designing the  
template should know what goes where?

Am 07.10.2006 um 05:39 schrieb Mark Nottingham:

> Actually, by putting what's effectively an encoding type in the  
> input data structure, we *can* have both;
>
> {
>   'a': ('foo/bar', PATH_SEGMENT),
>   'b': ('foo/bar', NULL),
>   'c': ('foo/bar', QUERY_STRING),
> }
> http://example.com/{a}/{b}?{c}  -->  http://example.com/foo%2f/foo/ 
> bar?foo/bar
>

here you declare how the input shall be treated as attribute of the  
input. What about this:

('foo/bar', 'foo/bar', 'foo/bar')

http://example.com/{1ps}/{2}?{3q}  -->  http://example.com/foo%2f/foo/ 
bar?foo/bar

n - substitue n-th parameter unchanged
np - substitue n-th with uri escaping to make a valid path
nps - substitue n-th with uri escaping to make a valid path segment
nq - substitue n-th with uri escaping to make a valid query

Instead of positional, numbered parameters, one can apply the same to  
named parameters, as in

http://example.com/{ps(a)}/{b}?{q(c)}

Cheers,

Stefan
Received on Saturday, 7 October 2006 09:45:56 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:10 UTC