Linq To Xml problems using XElement's method Elements(XName)

前端 未结 2 1093
故里飘歌
故里飘歌 2021-01-13 22:00

I have a problem using Linq To Xml.

A simple code. I have this XML:




        
2条回答
  •  囚心锁ツ
    2021-01-13 22:48

    For me I solved it like that because I didn't had a namespace in my XML:

    xmldoc.Root.Elements("contact");
    

    I forgot to use the "Root" method.

提交回复
热议问题