> It does seem to be quite common to have:
>
> <vm href=".../vms/{id}">
>   ...
> </vm>
>
> but bburke advocates the Atom link style>
>
> <vm>
>   <link rel="self" href=".../vms/{id}/" type="application/xml"/>
> </vm>
>
> Since we're likely to use <link>s for e.g. actions, I think it makes
> sense to use it in this case too


Hi Mark,

On the question of the href attribute versus <link> child element, I agree that consistency with the action-related link elements is neater.

But here's another slightly related point, how about indicating a more informative type than "application/xml" via the type attribute, say something vendor-specific like "application/vnd.com.redhat.rhevm.api+xml" or even "application/vnd.com.redhat.rhevm.api.VM+xml"?

The reason being that this would make it absolutely explicit we're not just talking plain ol' XML, but rather an application-specific hypermedia type. This type may also be explicitly advertized in the Content-Type header of the response when the link is dereferenced, which kinda makes our application protocol manifest at the standard HTTP level, as opposed to just embedding this same info in the entity-body (say in the root namespace of the XML payload).

Cheers,
Eoghan


On 9 April 2010 09:34, Mark McLoughlin <markmc@redhat.com> wrote:
On Thu, 2010-04-08 at 12:15 +0200, Geert Jansen wrote:

> If we do return the entity, then the location should be in the <vm
> href="xxx"> attribute in my view.

Does anyone know where the 'href' attribute comes from? Something core
to XML itself?

It does seem to be quite common to have:

 <vm href=".../vms/{id}">
   ...
 </vm>

but bburke advocates the Atom link style>

 <vm>
   <link rel="self" href=".../vms/{id}/" type="application/xml"/>
 </vm>

Since we're likely to use <link>s for e.g. actions, I think it makes
sense to use it in this case too

Cheers,
Mark.