Re: URI Templates: { ^ prefix ^ variable [] separator | default }

Marc Hadley wrote:
> 
> On Oct 26, 2007, at 11:05 AM, Joe Gregorio wrote:
> 
>> On 10/26/07, Marc Hadley <Marc.Hadley@sun.com> wrote:
>>>
>>> On Oct 23, 2007, at 1:14 AM, Manger, James H wrote:
>>>>
>>>> The syntax is XML-friendly compared to Joe's. Joe's uses < > and &,
>>>> which require escaping in XML -- making templates more awkward to
>>>> read and write. < and > are already used as delimiters in HTTP
>>>> headers, particularly the proposed Link-Template header. There may
>>>> not be a clash if < and > only appear inside {…} within a template,
>>>> but it adds some confusion.
>>>>
>>> IMO, this is an important consideration. I think its highly likely
>>> that templates will be embedded in XML documents and having to escape/
>>> unescape delimiters in templates will be a pain.
>>
>> This is a non issue.
>>
>> Even if the <op>'s are changed to something more XML 'friendly'
>> you still have to escape because <arg> may contain & and ',
>> so you still have to escape. Also, let's look at the bigger picture:
>>
>>   & and ' are legal characters in URIs, not even URI Templates,
>>      and are "problematic" for XML.
>>   ; is legal and sure to cause problems in SQL.
>>   { and } will cause issues with many templating engines.
>>
>> This is why XML, SQL and templating engines have escaping rules.
>>
> I respectfully disagree. Even though a URI *may* contain problematic
> characters that isn't a good justification for using <op>'s that *will*
> require escaping. I'd like URI templates to be (at least somewhat)
> readable and choosing <op> characters that will always have to be
> escaped when used in XML seems masochistic in this regard.

I agree (mildly) with this, but how far should we go - is it OK to leave
it at XML languages, or are there other document formats that are likely
to contain URI templates which we'd expect to have to play nicely with?

- John

> 
> Marc.
> 
> ---
> Marc Hadley <marc.hadley at sun.com>
> CTO Office, Sun Microsystems.
> 
> 
> 

Received on Friday, 26 October 2007 16:02:24 UTC