UserPreferences

PaceObjectModule


Abstract

This proposal introduces the XHTML Object Module to Atom, and removes the current semantics of the type="multipart/alternative" attribute of <content>, with the aim of providing a simpler and more consistent way of dealing with multipart posts, compound posts, and resources that are not Atom entries.

Status

Closed

Rationale

This proposal attempts to solve the same problems identified in PaceDontSyndicate with a different solution. See that Pace's Rationale section for discussion on the [WWW]Atom Syndication Format 0.3 pre-draft's problematic notion of compound entries:

"Put simply, the Web doesn't know about compound objects."

Other syndication formats and APIs offer methods of dealing with resources that are not entries, either alone, or together with an entry. Atom can provide similar functionality by extending the [WWW]XHTML Object Module.

By adopting the module, Atom can support the posting of graphics and other multimedia objects (alone or together with an entry), references to external media objects (as with [WWW]RSS2 Enclosures), and the inclusion of related media content inline if necessary.

Proposal

Replace the body of [WWW]4.13.10 with: "The 'atom:content' element is a Content construct that conveys the content of the entry. An atom:entry element MAY contain one or more atom:content elements"

Add section 4.14 as follows:

4.14 "atom:object" Element

The atom:object element is an extension of the XHTML Object Element defined in the [WWW]Modularization of XHTML. atom:object represents resources that are not atom:entries; this includes images, video, and executable content.

atom:feed elements MAY contain one or more atom:object elements.

The atom:object element MAY contain any namespace-qualified [WWW]W3C.REC-xml-names-19990114 elements as children. Ordering of the element children of atom:object element MUST NOT be considered significant.

This specification extends the definition of the XHTML Object element as follows:

4.14.1 "atom:payload" Element

The "atom:payload" element's content is an inline representation of the resource at the URI given in the atom:object's data attribute. The content MUST have the same media type as the value of the atom:object's type attribute. atom:object elements MAY contain a single atom:payload element.

4.14.2 "atom:link" Element

The "atom:link" element is a Link construct that conveys a URI associated with the object. The nature of the relationship as well as the link itself is determined by the element's content.

atom:object elements MAY contain one or more atom:link elements.

4.14.3 "type"

"This attribute specifies the content type of the resource designated by the data attribute." atom:object elements MUST have a type attribute.

4.14.4 "data" attribute

The URI ([WWW]RFC2396) specifies the location of the object's data. atom:object elements MUST have a data attribute.

4.14.5 "content-length" attribute

"This attribute is to be used as a hint by the object handler. The author may provide the object handler with the physical size of the object data that is to be processed. A valid value is the same as defined in section 14.13 of [WWW]RFC2616."

atom:object elements MAY include a content-length attribute. If an atom:payload element is not present, atom:object elements MUST have a content-length attribute.

4.14.6 "id" attribute

"A document-unique identifier." atom:object elements MAY have an id attribute. Other items in an Atom feed MAY reference an atom:object with the value of this attribute.

Examples

Post an entry along with an image

Request

(forgive the lack of root element, that's a separate issue)

POST /t/atom/weblog/blog_id=1 HTTP/1.1 
    Host: www.typepad.com
    X-WSSE: my credentials

<?xml version="1.0" encoding='utf-8'?>
<entry xmlns="http://purl.org/atom/ns#">
  <title>Trip to the Lake</title>
  <issued>2003-09-08T03:32:51Z</issued>
  <content type="application/xhtml+xml" mode="xml"><div xmlns="http://www.w3.org/1999/xhtml"><img src="#Image_16" /> Here is a picture of me at the lake.</div></content>
</entry>
<object id="Image_16" type="image/jpeg">
  <payload> .... </payload>
</object>
Response
HTTP/1.1 200 
Content-Type: application/x.atom+xml

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://purl.org/atom/ns#">
  <title>Trip to the Lake</title>
  <content mode="xml"><div xmlns="http://www.w3.org/1999/xhtml"><img src="http://example.typepad.com/photos/vacation/lake-thumb.jpg" /> Here is a picture of me at the lake.</div></content>
  <issued>2003-10-23T18:35:51Z</issued>
  <link rel="alternate" href="http://example.typepad.com/weblog/2003/10/trip_to_the_lake.html" type="text/html" />
  <id>tag:typepad-com:post:3</id>
  <link rel="service.edit" href="http://www.typepad.com/t/atom/weblog/blog_id=1/entry_id=3" title="Trip to the Lake" type="application/x.atom+xml" />
</entry>
<object data="http://example.typepad.com/photos/vacation/lake-thumb.jpg" type="image/jpeg" content-length="1234">
  <link rel="service.edit" href="http://www.typepad.com/t/atom/weblog/blog_id=1/object_id=foo" title="Trip to the Lake Photo" type="image/jpeg" />
</object> 

Impacts

The structure of an atom:entry is simplified, a new child element of feed is added, and the design patterns for posting compound entries change.

Notes

Discussion



CategoryProposals