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

Re: URI templates and "back references" - a question

From: Marc Hadley <Marc.Hadley@Sun.COM>
Date: Tue, 23 Oct 2007 10:00:00 -0400
To: John Kemp <john@jkemp.net>
Cc: URI <uri@w3.org>
Message-id: <8798622D-C35A-49E8-B522-124F8DA74EF3@Sun.COM>

On Oct 22, 2007, at 11:45 AM, John Kemp wrote:
>
> I have written some simple C code to process and match URI templates
> against URIs. I'm using the "va_list" approach to create a C function
> that takes a URI template (as a string) and a variable-length list of
> string values to put into the template, creating a URI with all
> substitutions made.
>
> I can't tell from the specification whether this is a good idea ;)
>
I think there's a place for positional substitutions, the current JAX- 
RS UriBuilder has support for both positional and named variables in  
the build methods:

https://jsr311.dev.java.net/nonav/javadoc/javax/ws/rs/core/ 
UriBuilder.html

> But, for this usage, I don't really need named variables. I could
> certainly choose to use distinct variable names anyway, and  
> essentially
> discard them during the substitution, but my usage seems a little
> similar to the idea of backreferences in regular expressions, and I  
> was
> wondering whether it makes any sense to standardize a variable name  
> for
> when the name is not important, or for a specific ordering of values?
>
Even if we allowed anonymous variables I'm not sure the specification  
would be the right place to define default names. Seems to me like  
that is something that a URI template library could do itself. What's  
your use case for a default name ?

Cheers,
Marc.

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.
Received on Tuesday, 23 October 2007 14:00:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 13 January 2011 12:15:37 GMT