I have a TreeView Control on my form which displays an XML file as a tree. And a change button to change the values of the elements in the xml file. I want to do this:
when a user selects a node from the treeview, i want to find that element/value in my xml file. And if the user wants to change its value, he/she types the new value into a textbox and presses the change button. And i want the selected element/value in my xml file to be changed to the new value.
XPath's SelectSingleNode would work with the name of the element. But the thing is there are multiple elements with the same name but different values.
like:
<catalog>
<book>
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
</book>
<book>
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
</book>
<book>
<author>Corets, Eva</author>
<title>Maeve Ascendant</title>
</book>
</catalog>
How to do that? Is it possible to do that with XPathNavigator? I definitely prefer doing that with the help of XPathNavigator.
Any help is appreciated.