XPath and Selecting a single node

后端 未结 4 1397
北荒
北荒 2021-02-08 06:57

I\'m using XPath in .NET to parse an XML document, along the lines of:

XmlNodeList lotsOStuff = doc.SelectNodes(\"//stuff\         


        
4条回答
  •  梦谈多话
    2021-02-08 07:33

    If "stuffChild" is a child node of "stuff", then your xpath should just be:

    XmlNode stuffChild = stuff.SelectSingleNode("stuffChild");
    

提交回复
热议问题