This project has moved. For the latest updates, please go here.

Atom support

Topics: Developer Forum
Jan 11, 2007 at 7:58 AM
I was wondering if there are plans to support Atom feeds?

Many websites offer their feeds in the Atom format, and I think RSS Toolkit's biggest weakness is lack of support of if.

I hope you will consider supporting Atom.

Keep up the good work!

- foersom
Coordinator
Jan 19, 2007 at 11:47 PM
This discussion has been copied to Work Item 7478. You may wish to continue further discussion there.
Apr 5, 2007 at 6:29 PM
I downloaded the piyushshah build, the note on the download page said that ATOM support had been added but after testing it the build was the same as the rest, no ATOM support. Was this a mistake, is there a build that has ATOM support? Please let me know.
Apr 21, 2007 at 2:56 PM
first of all i have to say sorry for my english and i have to say that i didn't study so muche all the project and that it is the first time i have to fight against feed atom or rss , by the way i downloaded the last software source version from here and i modified the following class:
public static T DeserializeFromXmlUsingStringReader<T>(string xml) where T : RssDocumentBase
i surrounded the row "return (T)xmlSerializer.Deserialize(strngReader);" with a try
try
{
using (StringReader strngReader = new StringReader(xml))
{
return (T)xmlSerializer.Deserialize(strngReader);
}
}
catch (Exception)
{
using (StringReader strngReader = new StringReader(xml))
{
XmlDocument azz = new XmlDocument();
azz.LoadXml(xml);
HttpContext context = HttpContext.Current;
string sPrefix = context.Server.MapPath(ConfigurationSettings.AppSettings"xsltPath".ToString());

string sNomeXslt = sPrefix+@"\Atom1ToRss.xsl";
foreach (XmlNode nod in azz)
{
if (nod.Name.ToLower().StartsWith("feed"))
{
if(nod.Attributes"xmlns".Value.ToLower().StartsWith("http://purl.org/atom/ns"))
{
sNomeXslt = sPrefix + @"\atom03-to-rss20.xsl";
}
}

}
XslTransform myXsl = new XslTransform();
myXsl.Load(sNomeXslt);
XPathDocument xpath = new XPathDocument(strngReader);
using (XmlReader doc = myXsl.Transform(xpath, null))
{
return (T)xmlSerializer.Deserialize(doc);
}
}

then i modified the web.config putting in the appsettings the follow
<add key="xsltPath" value="./"/>
and finally i put into the web site root some xslt files to Transform atom xml in rss 2.

Atom1ToRss.xsl that u can find here http://atom.geekhood.net/atom2rss.xsl
and that is needed to transform Atom 1.0 in RSS 2

for atom 0.3 i downloaded and partially modified the xsl files from here
http://www.aaronland.info/xsl/atom/0.3/

be carefull that for this last file u have to download also library version 1.1 (NOT 1.2)
from here http://sourceforge.net/projects/xsltsl/

Now i can read atom btw i have maden not so much tries , and i've used only the page RssDocument.aspx.

i wrote quickly since i feared i would have forget to do.. :) by the way i'll try to make rssdatasource working too
by
Apr 22, 2007 at 6:11 AM
Thanks adicicco, im going to give this a go, will let you know how I get on.
Coordinator
Apr 23, 2007 at 10:06 PM
The upcoming 2.0 release adds full support for ATOM, RDF and OPML feeds as well as conversion from one format to another and aggregation of the OPML-referenced sub-feeds.
Apr 24, 2007 at 9:47 AM

IDisposable wrote:
The upcoming 2.0 release adds full support for ATOM, RDF and OPML feeds as well as conversion from one format to another and aggregation of the OPML-referenced sub-feeds.

wanderfull!!! but when do u think it will be released?
in my way i've modified u'r last source v2 to convert Atom 0.3 to Atom 1 with xslt i've found here
http://atom.geekhood.net/
to use it i've put this constant to Constants.cs
public const string Atom0ToAtom1 = "RssToolkit.Resources.Atom2Atom.xsl";
where Atom2Atom.xsl is the xslt stylesheet "Embedded" i downloaded from the mentioned url and put inside Resources.

i modifed the DocumentType.cs
inserting after rdf the "new" type Atom0 like that:
Rdf,

/// <summary>
/// Atom 0.3 Document Type
/// </summary>
Atom0
}

then I've modified RssXmlHelper.cs, first of all the
public static DocumentType GetDocumentType(string url, out string xml)
modifying the row
else if (xmlDocument.DocumentElement.LocalName.Equals("feed", StringComparison.InvariantCultureIgnoreCase))
{
if (xmlDocument.DocumentElement.Attributes"xmlns".Value.StartsWith("http://www.w3.org/2005/Atom", true, null))
return DocumentType.Atom;
else
return DocumentType.Atom0;
}

then i modified the public static string ConvertToRss like that
case DocumentType.Atom0:
xslFileName = Constants.Atom0ToAtom1;
inputXml = ConvertAtom2Atom(xslFileName, inputXml);
xslFileName = Constants.AtomToRssXsl;
break;

to call my new function ConvertAtom2Atom that returns a string.
public static string ConvertAtom2Atom(string xslFileName, string inputXml)
{
string returnValue;
Assembly assembly = Assembly.GetExecutingAssembly();
Stream stream = assembly.GetManifestResourceStream(xslFileName);
using (StringWriter outputWriter = new StringWriter(System.Globalization.CultureInfo.InvariantCulture))
{
using (StringReader stringReader = new StringReader(inputXml))
{
XPathDocument xpathDoc = new XPathDocument(stringReader);
XslCompiledTransform transform = new XslCompiledTransform();
using (XmlTextReader styleSheetReader = new XmlTextReader(stream))
{
transform.Load(styleSheetReader);
transform.Transform(xpathDoc, null, outputWriter);
}
}

returnValue = outputWriter.ToString();
}

return returnValue;

}


for now it is working :D by the way i wish to have Your code that, sure thing, will be lot's better than mine.
so please can u share with us also a pre-release??

thank u all for the good work
May 30, 2007 at 3:09 AM

IDisposable wrote:
The upcoming 2.0 release adds full support for ATOM, RDF and OPML feeds as well as conversion from one format to another and aggregation of the OPML-referenced sub-feeds.


Hi IDisposable,

May I know when v2.0 is expected to be released? I'm really looking forward to the ATOM (and other feed format) support.