Python's xml.etree getiterator equivalent to C#

后端 未结 2 1139
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-24 08:44

I have this XML file : http://dl.dropbox.com/u/10773282/2011/perf.xml

\"enter

It h

相关标签:
2条回答
  • 2021-01-24 09:02

    Try:

    using System.Xml;
    // ...
    XmlDocument xmlDoc = new XmlDocument();
    xmlDoc.Load(filename);
    var matches = xmlDoc.SelectNodes("//Class/ClassKeyName");
    
    0 讨论(0)
  • 2021-01-24 09:12

    You should try Linq to XML... Quite easy to use:

    var xml = XDocument.Load(filename);
    var res = from p in xml.Root.Elements("Class").Elements("ClassKeyName") select p.Value;
    
    0 讨论(0)
提交回复
热议问题