XDocument.Element returns null when parsing an xml string

后端 未结 4 2035
悲哀的现实
悲哀的现实 2021-01-18 09:43

I have this xml string:



        
4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-18 10:30

    a is a namespace. To get the feed element try this:

    XDocument doc = XDocument.Parse(xmlString);
    XNamespace a = "http://www.w3.org/2005/Atom";
    var feed = doc.Element(a + "feed");
    

提交回复
热议问题