Loading ...
Sorry, an error occurred while loading the content.

17943Re: [rest-discuss] Using URI templates in XHTML

Expand Messages
  • Mike Kelly
    Nov 9, 2011


      On Wed, Nov 9, 2011 at 6:06 PM, Eric J. Bowman <eric@...> wrote:
      "Philippe Mougin" wrote:
      >
      > Question:
      > *********
      > I'd like to use URI template as hypermedia control in XHTML, as a
      > (richer) alternative to my existing forms. What do you think is the
      > best way to do so ? Specifically, how would you represent an URI
      > template in XHTML (given it must be used as a hypermedia control for
      > programatic clients)?
      >

      Consensus will need to be reached, eventually, but I'd suggest that URI
      templates be integrated into (X)HTML with new attributes -- any existing
      attribute which takes a URI (@href, @src etc.) may take a suffix of 't'
      to indicate the presence of an expansion model which yields a URI
      (@hreft, @srct etc.).

      The real problem is how to indicate the allowable values for expansions,
      for the purpose of generating a list of possible state transitions (just
      like a form).  I can imagine doing this in XForms, and having a re-
      usable library.  I don't know the nature of the library you mention, but
      code-on-demand is just as valid for generating a list of links (even as
      a GET <form>).


      There's already an adequate solution to that problem - you can define the inputs up-front against the link relation in question.

      e.g. the link relation 'circle' has an href containing a URI template which accepts the variable 'radius'

      which tells you what you need to know to build an automated client which follows this link:

      <a rel="circle" href="/circle/radius;{radius}" />

      Cheers,
      Mike
    • Show all 19 messages in this topic