Parsing XML file using C#?

前端 未结 3 1322
故里飘歌
故里飘歌 2021-02-04 10:06

I\'m new to both XML and C#; I\'m trying to find a way to efficiently parse a given xml file to retrieve relevant numerical values, base on the \"proj_title\" value=heat_run or

3条回答
  •  无人共我
    2021-02-04 10:48

    You can use XPath to find all nodes that match, for example:

    XmlNodeList matches = xmlDoc.SelectNodes("proj[proj_title='heat_run']")

    matches will contain all proj nodes that match the critera. Learn more about XPath: http://www.w3schools.com/xsl/xpath_syntax.asp

    MSDN Documentation on SelectNodes

提交回复
热议问题