La raison pour laquelle vous ne pouvez obtenir aucun noeud de canal est que le format atom n'a aucun noeud de canal. vérifier suivant
Votre deuxième liaison est un fil Rss, qui contient le noeud de canal comme ce qui suit
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>Engadget</title>
<link>http://www.engadget.com</link>
.
.
.
D'autre part un flux d'atomes ne pas utiliser le canal nœuds, comme vous pouvez le comprendre en suivant le lien de spécification ci-dessus.
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text">dive into mark</title>
<subtitle type="html">
A <em>lot</em> of effort
went into making this effortless
</subtitle>
<updated>2005-07-31T12:29:29Z</updated>
<id>tag:example.org,2003:3</id>
<link rel="alternate" type="text/html"
hreflang="en" href="http://example.org/"/>
<link rel="self" type="application/atom+xml"
href="http://example.org/feed.atom"/>
<rights>Copyright (c) 2003, Mark Pilgrim</rights>
<generator uri="http://www.example.com/" version="1.0">
Example Toolkit
</generator>
<entry>
.
.
.
EDIT: Pour vérifier l'alimentation Format
// url of the feed
string utlToload = @"http://feeds.feedburner.com/punchfire?format=xml"
// load feed
Argotic.Syndication.GenericSyndicationFeed feed =
Argotic.Syndication.GenericSyndicationFeed.Create(new Uri(urlToLoad));
// check what format is it
if (feed.Format.Equals(SyndicationContentFormat.Rss))
{
// yourlogic here
}
else if (feed.Format.Equals(SyndicationContentFormat.Atom))
{
// yourlogic here
}
else if (feed.Format.Equals(SyndicationContentFormat.NewsML))
{
// yourlogic here
}
Hope it helps
il figure. Merci pour l'aide. Je peux utiliser l'analyseur d'atome pour RSS.NET. savez-vous un moyen de déterminer simplement en regardant l'URL si un flux est rss ou atome? – Farooq
c'est la partie la plus délicate et malheureusement, jusqu'à ce que vous ayez chargé le fichier depuis la source, il n'est pas possible de vérifier dans quel format il se trouve. (Je ne suis pas sûr, mais nous l'avons utilisé) –