RFC: RSS 2.0 and the MetaWeblog API
Sun, Jan 12, 2003; by Dave Winer.
Background 
In the MetaWeblog API, the defined members of the struct passed in newPost and editPost come from the elements of <item>s in RSS 2.0.
The most commonly used core elements have no attributes, so it's clear how to include them in the struct. However, some less commonly used elements, such as source, enclosure and category, may have attributes and a value. Further, RSS 2.0 allows for the use of namespaces. The MetaWeblog API spec doesn't say how to include these in the struct, so we do that in this document.
Attributes 
If an element has attributes, as the enclosure element does, then make the element itself a struct, and include the attributes in the struct. The MetaWeblog API spec is clear on this, that's what it says to do.
However if an element, like source, has both attributes and a value, make the element a struct, include the attributes as sub-elements, and create a sub-element for the value with the name _value.
Elements of namespaces 
If you wish to transmit an element that is part of a namespace include a sub-struct in the struct passed to newPost and editPost whose name is the URL that specifies the namespace. The sub-element(s) of the struct are the value(s) from the namespace that you wish to transmit.
|