I have an XML file which is similar to below. At the moment if I want to change values I have to go into the XML and change/add/remove records as required.
<configuration>
<locations>
<add key="1234" type="Type1" location="Default Location 1" value="10"/>
<add key="4567" type="Type2" location="Default Location 1" value="13"/>
<add key="7890" type="Type1" location="Default Location 2" value="17"/>
</locations>
</configuration>
I'm writing a Windows Form GUI for this and a few other XMLs which the software uses. I can get/putsettings in the other XMLs as they have node names, but this file, (when originally created) was made differently.
I need to get each row as a string so I can then split it and display what I need on the screen (key/type/location/value). I then need to update the file with the information when updated.
I'm looking for some help in:
retrieving all node attributes within
<locations>
clearing out all nodes within
<locations>
and then adding the nodes with attributes back into so that all eventualities are considered (records removed/added/updated) etc