I found answers for searching XML nodes using LINQ, but I am limited to C# with .NET 2.
I want to open a single XML file (~50Kb, all simple text) and search for all <Tool> nodes with attribute name having a specific value.
It seems like XmlDocument.SelectNodes() might be what I’m looking for, but I don’t know XPath. Is this the right way and if so what would code look like?
You can use XPath in XmlDocument.SelectNodes such as:
SelectNodes("//ElementName[@AttributeName='AttributeValue']")Xml Sample:
C# Sample:
Here you can find some additional XPath samples