[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
atom:content's src and server-driven content negotiation
I don't want to start yet another discussion about violating SHOULD
level requirements but I can't think of any better way to handle the
following situation (but hopefully you can :-):
Suppose the host www.example.com uses HTTP/1.1's server-driven content
negotiation for its resource /img which has both image/png and
image/svg+xml representations. Furthermore these representations can be
accessed explicitly as /img.png and /img.svg, respectively.
Now a straight-forward way to compose an entry describing /img would be
as follows:
<entry>
<title>Some Example Image</title>
<summary>A short summary of the example image</summary>
<link rel="alternate" type="image/png"
href="http://www.example.com/img.png" />
<link rel="alternate" type="image/svg+xml"
href="http://www.example.com/img.svg" />
<content src="http://www.example.com/img" />
<!-- author, id, updated -->
</entry>
Note, however, that a type attribute on the content element cannot be
used since /img is a negotiated resource -- this violates the SHOULD in
4.1.3.2.: 'If the "src" attribute is present, the "type" attribute
SHOULD be provided [...].'
Of course one can compose an entry without a content element, simply
listing /img among the alternate versions, but at least to me this
feels, in the above scenario, wrong (although I cannot really put my
finger on it):
<entry>
<title>Some Example Image</title>
<summary>A short summary of the example image</summary>
<link rel="alternate"
href="http://www.example.com/img" />
<link rel="alternate" type="image/png"
href="http://www.example.com/img.png" />
<link rel="alternate" type="image/svg+xml"
href="http://www.example.com/img.svg" />
<!-- author, id, updated -->
</entry>
So do you have any suggestions how to best deal with a scenario like
this? Which of the above entries is preferable?
Regards,
Andreas Sewe