Questions about embedding microcontent in an Atom feed
Imagine I wanted to write a new type of aggregator that could extract microcontent from feeds and then present that content in a way different from a normal 'news' aggregator. For example I might want to allow people to include 'event' information in their feeds and have my aggregator provide a calendar-like view onto all the events it had encountered.
Does the Atom Syndication Format help me do that?
Lets make the simplifying assumption that there is some well-defined, commonly-used way of representing a calendar event in XML with its own mime-type (lets postulate text/vcalendar+xml). I want to include both this 'structured' microcontent as well as my usual 'unstructured' ramblings into a single entry. My question is how is such hybrid content supposed to be included in an Atom feed?
AFAICT entries in Atom may have multiple <content> elements. Thus you could include the calendar event information and the wordy bits in separate <content> elements, each with the appropriate type attribute. However my understanding of things I have read elsewhare (but I can't find them now so this may be madness <UPDATE> more below </UPDATE>) is that under such circumstances the aggregator should pick a single content element to deliver. A possible example might be an aggregator that is delivering to a mobile device with limited capabilities. Under such circumstances content of type 'text/plain' might win out over content with type 'application/xhtml+xml'. What it would do faced with 'text/vcalendar+xml' and 'application/xhtml+xml' is anybody's guess.
However the multiple <content> element route has other issues. For example I suspect most blog authoring software does not make it easy to deliver multiple content elements. Finally, even if they did, how does this approach handle the situation when the entry needs to reference a pair of calendar events? (or is the 'rel' attribute is available on the 'content' element?)
So I am driven to ask the question whether it is possible/legal/good manners to put structured microcontent directly into the XHTML content?
I have just found some words about consumers of Atom only rendering a single content element. However this is based on a content element with type 'multipart/alternative'. Taken from IETF Draft of the Atom Syndication Format:
If @type="multipart/alternative", @mode MUST NOT be specified, and content element MUST contain 1 or more content elements. These content elements MUST NOT specify @type="multipart/alternative" (i.e. only one level of nesting is allowed). Consumers SHOULD look at all alternative content elements and determine which one is most suitable, based on which @type and @mode the consumer supports, and preferences specified by the end user (if any). Consumers SHOULD NOT render more than one content alternative.
Comments