Quantcast
Channel: Read ReadElementExtensions from RSS ATOM - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Read ReadElementExtensions from RSS ATOM

$
0
0

I have the following code and I cannot deserialize a RSS ATOM feed to a class. The "team" node cannot be read and the rest of the properties don't seem to be getting filled. When I comment out the "team" node.

This is my code:

The URL of the RSS feed:http://www.volleybal.nl/application/handlers/export.php?format=rss&type=poule&standen=D3K&iRegionId=7000

    public static SyndicationFeed GetFeed(string feedUrl)    {        Uri serviceUri = new Uri(feedUrl);        WebClient downloader = new WebClient();        Stream responseStream = downloader.OpenRead(serviceUri);        XmlReader responseReader = XmlReader.Create(responseStream);        SyndicationFeed syndicationFeed = SyndicationFeed.Load(responseReader);        return syndicationFeed;    }System.Collections.ObjectModel.Collection<Stand> oo = programFeed.ElementExtensions.ReadElementExtensions<Stand>("ranking", "http://www.nevobo.nl/competitie/");[Serializable][XmlSerializerFormat][DataContract(Name = "stand", Namespace = "http://www.nevobo.nl/competitie/")][XmlRoot(ElementName = "stand", Namespace = "http://www.nevobo.nl/competitie/")]public class Stand{    public Stand()    {    }    [DataMember(Name = "nummer")]    [XmlElement("nummer")]    public string Nummer { get; set; }    [DataMember(Name = "team")]    [XmlElement("team")]    public Team Team { get; set; }    [DataMember(Name = "wedstrijden")]    [XmlElement("wedstrijden")]    public string Wedstrijden { get; set; }    [DataMember(Name = "punten")]    [XmlElement("punten")]    public string Punten { get; set; }    [DataMember(Name = "setsvoor")]    [XmlElement("setsvoor")]    public string Setsvoor { get; set; }    [DataMember(Name = "setstegen")]    [XmlElement("setstegen")]    public string Setstegen { get; set; }    [DataMember(Name = "puntenvoor")]    [XmlElement("puntenvoor")]    public string Puntenvoor { get; set; }    [DataMember(Name = "puntentegen")]    [XmlElement("puntentegen")]    public string Puntentegen { get; set; }}[Serializable]//[XmlSerializerFormat]//[DataContract(Name = "team")][DataContract(Name = "team", Namespace = "http://www.nevobo.nl/competitie/")]//[XmlRoot(ElementName = "team", Namespace = "http://www.nevobo.nl/competitie/")]//[System.Xml.Serialization.XmlType(AnonymousType = true)]public class Team{    public Team()    {    }    [DataMember(Name = "id")]    [XmlAttribute(AttributeName ="id")]    public string Id { get; set; }    [DataMember]    [XmlText]    public string Text { get; set; }}

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images