Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From .NET 3.5 you can do this below. It will throw an exception if it's not a valid feed.</p> <pre><code>using System.Diagnostics; using System.ServiceModel.Syndication; using System.Xml; public bool TryParseFeed(string url) { try { SyndicationFeed feed = SyndicationFeed.Load(XmlReader.Create(url)); foreach (SyndicationItem item in feed.Items) { Debug.Print(item.Title.Text); } return true; } catch (Exception) { return false; } } </code></pre> <p>Or you can try parsing the document by your own:</p> <pre><code>string xml = "&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&gt;\n&lt;event&gt;This is a Test&lt;/event&gt;"; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(xml); </code></pre> <p>Then try checking the root element. It should be the feed element and have "<a href="http://www.w3.org/2005/Atom" rel="nofollow noreferrer">http://www.w3.org/2005/Atom</a>" namespace:</p> <pre><code>&lt;feed xmlns="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:re="http://purl.org/atompub/rank/1.0"&gt; </code></pre> <p>References: <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.syndication.syndicationfeed.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.servicemodel.syndication.syndicationfeed.aspx</a> <a href="http://dotnet.dzone.com/articles/systemservicemodelsyndication" rel="nofollow noreferrer">http://dotnet.dzone.com/articles/systemservicemodelsyndication</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload