Page 1 of 1

Atom or RSS

Posted: Sun Apr 06, 2008 8:05 am
by kendall
Hi,

I am building an application in which i would like to store information in an xml file. 1 of my reasons for storing the information in an xml file is to be used as a feed syndicate. Now i'm also using this file as a part of Ajax manipulation so that i wouldnt have to be going to a database all the time.

Now i have been looking at the two types of syntaxes for making up my xml....Atom and RSS. RSS i see is more popularly used however, Atom's syntax is more suited to my needs. My question is

Should i use atom's syntax specification to build my xml or should i use RSS's syntax and include my own tags to make up my xml file.

Please note the main reason i am building this xml file is to be used "ajaxly" on my site rather than having to hit a database all the time, "then" use it as a source for feeds

Thanks
Kendall

Re: Atom or RSS

Posted: Sun Apr 06, 2008 5:27 pm
by Christopher
Why not both?

Re: Atom or RSS

Posted: Sun Apr 06, 2008 5:36 pm
by kendall
arborint wrote:Why not both?
uhm? so what....2 files?. Please explain?

Re: Atom or RSS

Posted: Sun Apr 06, 2008 5:37 pm
by Christopher
We they both provide very similar information. And there is plenty of code around that will generate both. So create code that will display your data in either format.

Re: Atom or RSS

Posted: Sun Apr 06, 2008 5:52 pm
by kendall
can you use your own tags in an RSS or ATOM syntax xml in the first place?

do popular new aggregators have the ability to accept both in any instances? I'm leaning more to atoms feed but i was worried about the popularity of it.

Re: Atom or RSS

Posted: Mon Apr 07, 2008 2:30 am
by arjan.top
RSS and Atom are XML and XML is designed to be extensible, so yes you can add your own tags (this should not be a problem), but maybe you should put them in another namespace to validate

And I think most of RSS readers support both Atom and RSS ...

Re: Atom or RSS

Posted: Mon Apr 07, 2008 5:15 am
by kendall
arjan.top wrote:but maybe you should put them in another namespace to validate
What do you mean by this...declaring a DTD?

Re: Atom or RSS

Posted: Mon Apr 07, 2008 6:47 am
by arjan.top
Define custom namespace for custom tags, so RSS will be valid

Changed example from wikipedia:

Code: Select all

 
<?xml version="1.0"?>
<rss version="2.0" xmlns:mn="http://www.example.com/mynamespace">
  <channel>
    <title>Lift Off News</title>
    <link>http://liftoff.msfc.nasa.gov/</link>
    <description>Liftoff to Space Exploration.</description>
    <language>en-us</language>
    <pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
    <lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>Weblog Editor 2.0</generator>
    <managingEditor>editor@example.com</managingEditor>
    <webMaster>webmaster@example.com</webMaster>
    <ttl>5</ttl>
    <item>
      <title>Star City</title>
      <link>http://liftoff.msfc.nasa.gov/news/2003/ ... arcity.asp</link>
      <description>How do Americans get ready to work with Russians aboard the
        International Space Station? They take a crash course in culture, language
        and protocol at Russia's Star City.</description>
      <pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate>
      <guid>http://liftoff.msfc.nasa.gov/2003/06/03.html#item573</guid>
       <mn:customTag>content</mn:customTag>
    </item>
  </channel>
</rss>
 

Re: Atom or RSS

Posted: Mon Apr 07, 2008 7:04 am
by onion2k
kendall wrote:uhm? so what....2 files?. Please explain?
If you want to use two files, sure ... rss.php and atom.php for example. Or use one file like feed.php?format=rss and feed.php?format=atom. Or use mod_rewrite and have http://www.domain.com/feeds/rss and http://www.domain.com/feeds/atom. There's loads of ways of doing it.

Re: Atom or RSS

Posted: Mon Apr 07, 2008 10:32 am
by Mordred
kendall wrote:Now i'm also using this file as a part of Ajax manipulation so that i wouldnt have to be going to a database all the time.
Database will be faster (if done right) than opening an XML file and parsing it.

Re: Atom or RSS

Posted: Sun May 04, 2008 9:11 am
by kendall
arjan.top wrote:Define custom namespace for custom tags, so RSS will be valid
How do you create custom namespaces?

Re: Atom or RSS

Posted: Sun May 04, 2008 9:58 am
by arjan.top
it's in my example (xmlns:mn) :wink:

Re: Atom or RSS

Posted: Sun May 04, 2008 3:11 pm
by kendall
arjan.top wrote:it's in my example (xmlns:mn) :wink:

so how do you get atom feeds to read and parse it? will it be parsed? 8O :|

Re: Atom or RSS

Posted: Fri May 09, 2008 3:04 am
by Maugrim_The_Reaper
If possible use Atom - bit late really ;). But Atom has long been recognised as a fixed and standardised form of a collection in XML. Since it's standard, any feed parser will automatically support it, so additional parsing code can be either significantly reduced (requiring changes for any custom extensions to the XML) or eliminated.

There are any number of Atom parsers out there. Zend_Feed does it for example. So do Magpie, SimplePie, and countless other libraries.

Re: Atom or RSS

Posted: Fri May 09, 2008 3:57 am
by Chris Corbyn
SimplePie FTW!