Select XML node by attribute value
问题 <location> <hotspot name="name1" X="444" Y="518" /> <hotspot name="name2" X="542" Y="452" /> <hotspot name="name3" X="356" Y="15" /> </location> I have a point variable and I need to select the node with its coordinates, then change an attribute value. I want to do something similar to: let node = xmld.SelectSingleNode("/location/hotspot[@X='542' @Y='452']") node.Attributes.[0].Value <- "new_name2" but taking attributes value by a variable (variable_name.X / variable_name.Y). 回答1: Personally