Atom or RSS
Moderator: General Moderators
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Atom or RSS
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
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
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: Atom or RSS
uhm? so what....2 files?. Please explain?arborint wrote:Why not both?
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Atom or RSS
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.
(#10850)
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: Atom or RSS
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.
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
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 ...
And I think most of RSS readers support both Atom and RSS ...
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: Atom or RSS
What do you mean by this...declaring a DTD?arjan.top wrote:but maybe you should put them in another namespace to validate
Re: Atom or RSS
Define custom namespace for custom tags, so RSS will be valid
Changed example from wikipedia:
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
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.kendall wrote:uhm? so what....2 files?. Please explain?
Re: Atom or RSS
Database will be faster (if done right) than opening an XML file and parsing it.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.
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: Atom or RSS
How do you create custom namespaces?arjan.top wrote:Define custom namespace for custom tags, so RSS will be valid
Re: Atom or RSS
it's in my example (xmlns:mn) 
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: Atom or RSS
arjan.top wrote:it's in my example (xmlns:mn)
so how do you get atom feeds to read and parse it? will it be parsed?
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
Re: Atom or RSS
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.
There are any number of Atom parsers out there. Zend_Feed does it for example. So do Magpie, SimplePie, and countless other libraries.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Atom or RSS
SimplePie FTW!