Parsing xml file with linq

前端 未结 2 1131
攒了一身酷
攒了一身酷 2021-01-23 17:51

No matter what I try I am unable to parse this xml with linq and get the full-path value:




        
2条回答
  •  臣服心动
    2021-01-23 18:50

    You have a namespace, you need to specify it with your element name:

    XNamespace ns = "urn:oasis:names:tc:opendocument:xmlns:container";
    
    var rootFiles = xml.Descendants(ns + "rootfile");
    

提交回复
热议问题