Modifying a Atom file
for use in FeedSync
The original Atom feed used in this example can be found here Original To Do List. To support FeedSync, the publisher of this Atom feed first ran a simple script over it to add the FeedSync namespace definition to the root element:
<feed xmlns:sx="http://feedsync.org/2007/feedsync">
Then, each Atom item element is populated with a child <sx:sync> element, which specifies a globally unique ID, count of updates, an optional indication if the item was deleted and an optional indication if the item should preserve conflicts. Also, each <sx:sync> element is populated with at least one child <sx:history> element, which specifies when the last change was made and/or by whom.
Note that, for illustrative purposes, the tutorial uses different ID values for the <sx:sync> element and the <atom:id> element - in practice many implementations will use the same ID value when creating items, but should be prepared to handle the cases where they are different.
<sx:sync id="101" updates="1"
deleted="false" noconflict="false">
<sx:history
sequence="1"
when="2007-01-19T00:14:37Z" by="fsAtomConvert.js"/>
</sx:sync>
The resulting file, Version 1 which represents “Version 1” of
the to do list, is the common starting point for both endpoints in this
example. Each Atom item in this file now
has a child sync element and unique ID.
This is the minimum requirement for any Atom feed to be used in FeedSync, and
can easily be accomplished using a simple script.