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.
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 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 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 RSS2 Enclosures), and the inclusion of related media content inline if necessary.
Replace the body of 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 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 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.
"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 (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 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.
Post an entry along with an image
(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>
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>
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.